33
44import android .app .Activity ;
55import android .content .Context ;
6- import android .widget .Toast ;
76
87import com .facebook .react .bridge .*;
98import 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 ;
1310import com .zoyi .channel .plugin .android .model .etc .PushEvent ;
14- import com .zoyi .channel .react .android .*;
1511import com .zoyi .channel .react .android .Const ;
1612
1713import java .util .HashMap ;
@@ -51,11 +47,6 @@ public Map<String, Object> getConstants() {
5147 eventMap .put (Const .KEY_ON_CLICK_REDIRECT_LINK , Const .EVENT_ON_CLICK_REDIRECT_LINK );
5248 eventMap .put (Const .KEY_ON_CHANGE_PROFILE , Const .EVENT_ON_CHANGE_PROFILE );
5349
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-
5950 launcherPositionMap .put (Const .KEY_LAUNCHER_POSITION_RIGHT , Const .LAUNCHER_RIGHT );
6051 launcherPositionMap .put (Const .KEY_LAUNCHER_POSITION_LEFT , Const .LAUNCHER_LEFT );
6152
@@ -64,7 +55,6 @@ public Map<String, Object> getConstants() {
6455 bootStatusMap .put (Const .KEY_BOOT_ACCESS_DENIED , Const .BOOT_ACCESS_DENIED );
6556 bootStatusMap .put (Const .KEY_BOOT_NOT_INITIALIZED , Const .BOOT_NOT_INITIALIZED );
6657 bootStatusMap .put (Const .KEY_BOOT_REQUIRE_PAYMENT , Const .BOOT_REQUIRE_PAYMENT );
67- bootStatusMap .put (Const .KEY_BOOT_NOT_INITIALIZED , Const .BOOT_NOT_INITIALIZED );
6858
6959 constants .put (Const .Event , eventMap );
7060 constants .put (Const .Locale , localeMap );
@@ -81,8 +71,8 @@ public void boot(ReadableMap settings, final Promise promise) {
8171 ParseUtils .toProfile (Utils .getReadableMap (settings , Const .KEY_PROFILE )),
8272 new OnBootListener () {
8373 @ 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 ));
8676 }
8777 });
8878 }
@@ -121,7 +111,7 @@ public void openChat(String chatId, boolean animated) {
121111 public void initPushToken (String tokenData ) {
122112 Context context = getCurrentActivity ();
123113
124- if (context != null ){
114+ if (context != null ) {
125115 PrefSupervisor .setDeviceToken (context , tokenData );
126116 }
127117 }
@@ -131,9 +121,8 @@ public void handlePushNotification(ReadableMap userInfo, Promise promise) {
131121 if (reactContext != null ) {
132122 Context context = reactContext .getApplicationContext ();
133123
134- if (context != null ) {
135- ChannelIO .showPushNotification (context , ParseUtils .toPushNotification (userInfo ));
136- }
124+ if (context != null ) {
125+ ChannelIO .showPushNotification (context , ParseUtils .toPushNotification (userInfo ));
137126 }
138127
139128 promise .resolve (true );
@@ -143,7 +132,7 @@ public void handlePushNotification(ReadableMap userInfo, Promise promise) {
143132 public void handlePush () {
144133 Activity activity = getCurrentActivity ();
145134
146- if (activity != null ){
135+ if (activity != null ) {
147136 ChannelIO .handlePushNotification (activity );
148137 }
149138 }
@@ -198,18 +187,12 @@ public boolean onClickChatLink(String url) {
198187 return handleChatLink ;
199188 }
200189
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-
207190 @ Override
208191 public void onChangeProfile (String key , Object value ) {
209192 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 )
213196 );
214197 }
215- }
198+ }
0 commit comments