Closed dpz3579 closed 8 years ago
onesignal issues on ios event callback...
They are already integer (number) constants.
PushClient.MODE_FOREGROUND == 1
PushClient.MODE_CLICK == 2
PushClient.MODE_BACKGROUND == 3
PushClient.MODE_ACTION == 4
Check it out:
@property(nonatomic,readonly) NSNumber* MODE_FOREGROUND;
@property(nonatomic,readonly) NSNumber* MODE_CLICK;
@property(nonatomic,readonly) NSNumber* MODE_BACKGROUND;
@property(nonatomic,readonly) NSNumber* MODE_ACTION;
NSNumber* const CONST_MODE_FOREGROUND = 1;
NSNumber* const CONST_MODE_CLICK = 2;
NSNumber* const CONST_MODE_BACKGROUND = 3;
NSNumber* const CONST_MODE_ACTION = 4;
MAKE_SYSTEM_PROP(MODE_FOREGROUND,CONST_MODE_FOREGROUND);
MAKE_SYSTEM_PROP(MODE_CLICK,CONST_MODE_CLICK);
MAKE_SYSTEM_PROP(MODE_BACKGROUND,CONST_MODE_BACKGROUND);
MAKE_SYSTEM_PROP(MODE_ACTION,CONST_MODE_ACTION);
And it is not different to the onesignal or any other push notification provider.
ok... i didn't try on ios 8 & above,
i was testing on my old iphone 4, with ios 7.2, and was unable to get the status, so posted..
even there was one more change in this merge...
alert('Callback from Click:\n\n' + (OS_ANDROID) ? (JSON.stringify(JSON.parse(event.data.custom).a)) : JSON.stringify(event.data.custom.a));
the callback for click custom data is obtained in different format in ios & android.
even confirmed push opener is like.. for android Provider.confirmPushOpened(JSON.parse(event.data.custom).i) & for ios is Provider.confirmPushOpened(event.data.custom.i)
i found it while testing on ios & android..
the onesignal event call back returns numbers for MODE_FOREGROUND as 1 MODE_CLICK as 2 & so on...