File tree Expand file tree Collapse file tree 4 files changed +4
-14
lines changed
android/src/main/java/com/geektime/rnonesignalandroid Expand file tree Collapse file tree 4 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ public void addSMSSubscriptionObserver() {
269269 public void removeSMSSubscriptionObserver () {
270270 if (hasSetSMSSubscriptionObserver ) {
271271 OneSignal .removeSMSSubscriptionObserver (this );
272- hasSetSMSSubscriptionObserver = true ;
272+ hasSetSMSSubscriptionObserver = false ;
273273 }
274274 }
275275
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ + (void)sendEventWithName:(NSString *)name withBody:(NSDictionary *)body {
147147
148148RCT_EXPORT_METHOD (removeSMSSubscriptionObserver) {
149149 if (_hasSetSMSSubscriptionObserver) {
150- [OneSignal addSMSSubscriptionObserver : [RCTOneSignal sharedInstance ]];
150+ [OneSignal removeSMSSubscriptionObserver : [RCTOneSignal sharedInstance ]];
151151 _hasSetSMSSubscriptionObserver = false ;
152152 }
153153}
Original file line number Diff line number Diff line change @@ -69,16 +69,6 @@ export default class EventManager {
6969 handlerArray && handlerArray . length > 0 ? handlerArray . push ( handler ) : this . eventHandlerArrayMap . set ( eventName , [ handler ] ) ;
7070 }
7171
72- /**
73- * Adds the event handler to the corresponding handler array on the JS side of the bridge
74- * @param {string } eventName
75- * @param {function } handler
76- */
77- addEventHandler ( eventName , handler ) {
78- let handlerArray = this . eventHandlerArrayMap . get ( eventName ) ;
79- handlerArray && handlerArray . length > 0 ? handlerArray . push ( handler ) : this . eventHandlerArrayMap . set ( eventName , [ handler ] ) ;
80- }
81-
8272 /**
8373 * clears the event handler(s) for the event name
8474 * @param {string } eventName
Original file line number Diff line number Diff line change @@ -78,8 +78,8 @@ export default class OneSignal {
7878
7979 static clearSMSSubscriptionObservers ( ) {
8080 if ( ! isObjectNonNull ( RNOneSignal ) ) return ;
81- RNOneSignal . addSMSSubscriptionObserver ( ) ;
82- eventManager . addEventHandler ( SMS_SUBSCRIPTION_CHANGED , observer ) ;
81+ RNOneSignal . removeSMSSubscriptionObserver ( ) ;
82+ eventManager . clearEventHandler ( SMS_SUBSCRIPTION_CHANGED ) ;
8383 }
8484
8585 /* H A N D L E R S */
You can’t perform that action at this time.
0 commit comments