3
3
4
4
import android .app .Activity ;
5
5
import android .content .Context ;
6
- import android .widget .Toast ;
7
6
8
7
import com .facebook .react .bridge .*;
9
8
import com .zoyi .channel .plugin .android .*;
10
- import com .zoyi .channel .plugin .android .global .*;
11
-
12
- import com .facebook .react .bridge .ReadableMap ;
9
+ import com .zoyi .channel .plugin .android .global .PrefSupervisor ;
13
10
import com .zoyi .channel .plugin .android .model .etc .PushEvent ;
14
- import com .zoyi .channel .react .android .*;
15
11
import com .zoyi .channel .react .android .Const ;
16
12
17
13
import java .util .HashMap ;
@@ -51,11 +47,6 @@ public Map<String, Object> getConstants() {
51
47
eventMap .put (Const .KEY_ON_CLICK_REDIRECT_LINK , Const .EVENT_ON_CLICK_REDIRECT_LINK );
52
48
eventMap .put (Const .KEY_ON_CHANGE_PROFILE , Const .EVENT_ON_CHANGE_PROFILE );
53
49
54
- localeMap .put (Const .KEY_KOREAN , Const .LOCALE_KOREAN );
55
- localeMap .put (Const .KEY_JAPANESE , Const .LOCALE_JAPANESE );
56
- localeMap .put (Const .KEY_ENGLISH , Const .LOCALE_ENGLISH );
57
- localeMap .put (Const .KEY_DEVICE , Const .LOCALE_DEVICE );
58
-
59
50
launcherPositionMap .put (Const .KEY_LAUNCHER_POSITION_RIGHT , Const .LAUNCHER_RIGHT );
60
51
launcherPositionMap .put (Const .KEY_LAUNCHER_POSITION_LEFT , Const .LAUNCHER_LEFT );
61
52
@@ -64,7 +55,6 @@ public Map<String, Object> getConstants() {
64
55
bootStatusMap .put (Const .KEY_BOOT_ACCESS_DENIED , Const .BOOT_ACCESS_DENIED );
65
56
bootStatusMap .put (Const .KEY_BOOT_NOT_INITIALIZED , Const .BOOT_NOT_INITIALIZED );
66
57
bootStatusMap .put (Const .KEY_BOOT_REQUIRE_PAYMENT , Const .BOOT_REQUIRE_PAYMENT );
67
- bootStatusMap .put (Const .KEY_BOOT_NOT_INITIALIZED , Const .BOOT_NOT_INITIALIZED );
68
58
69
59
constants .put (Const .Event , eventMap );
70
60
constants .put (Const .Locale , localeMap );
@@ -81,8 +71,8 @@ public void boot(ReadableMap settings, final Promise promise) {
81
71
ParseUtils .toProfile (Utils .getReadableMap (settings , Const .KEY_PROFILE )),
82
72
new OnBootListener () {
83
73
@ Override
84
- public void onCompletion (ChannelPluginCompletionStatus status , Guest guest ) {
85
- promise .resolve (ParseUtils .getBootResult (RNChannelIO .this , status , guest ));
74
+ public void onCompletion (ChannelPluginCompletionStatus status , User user ) {
75
+ promise .resolve (ParseUtils .getBootResult (RNChannelIO .this , status , user ));
86
76
}
87
77
});
88
78
}
@@ -121,7 +111,7 @@ public void openChat(String chatId, boolean animated) {
121
111
public void initPushToken (String tokenData ) {
122
112
Context context = getCurrentActivity ();
123
113
124
- if (context != null ){
114
+ if (context != null ) {
125
115
PrefSupervisor .setDeviceToken (context , tokenData );
126
116
}
127
117
}
@@ -131,9 +121,8 @@ public void handlePushNotification(ReadableMap userInfo, Promise promise) {
131
121
if (reactContext != null ) {
132
122
Context context = reactContext .getApplicationContext ();
133
123
134
- if (context != null ) {
135
- ChannelIO .showPushNotification (context , ParseUtils .toPushNotification (userInfo ));
136
- }
124
+ if (context != null ) {
125
+ ChannelIO .showPushNotification (context , ParseUtils .toPushNotification (userInfo ));
137
126
}
138
127
139
128
promise .resolve (true );
@@ -143,7 +132,7 @@ public void handlePushNotification(ReadableMap userInfo, Promise promise) {
143
132
public void handlePush () {
144
133
Activity activity = getCurrentActivity ();
145
134
146
- if (activity != null ){
135
+ if (activity != null ) {
147
136
ChannelIO .handlePushNotification (activity );
148
137
}
149
138
}
@@ -198,18 +187,12 @@ public boolean onClickChatLink(String url) {
198
187
return handleChatLink ;
199
188
}
200
189
201
- @ Override
202
- public boolean onClickRedirectUrl (String url ) {
203
- Utils .sendEvent (reactContext , Const .EVENT_ON_CLICK_REDIRECT_LINK , ParseUtils .createSingleMap (Const .KEY_EVENT_LINK , url ));
204
- return handleRedirectLink ;
205
- }
206
-
207
190
@ Override
208
191
public void onChangeProfile (String key , Object value ) {
209
192
Utils .sendEvent (
210
- reactContext ,
211
- Const .EVENT_ON_CHANGE_PROFILE ,
212
- ParseUtils .createKeyValueMap (Const .KEY_PROFILE_KEY , key , Const .KEY_PROFILE_VALUE , value )
193
+ reactContext ,
194
+ Const .EVENT_ON_CHANGE_PROFILE ,
195
+ ParseUtils .createKeyValueMap (Const .KEY_PROFILE_KEY , key , Const .KEY_PROFILE_VALUE , value )
213
196
);
214
197
}
215
- }
198
+ }
0 commit comments