0.3.8
-
Carousel notification UI now supports title and subtitle.
-
To know users preference for the push notification, new NSNotification is created. Usage is given below:
To add observer to the notification after requesting the user for push notification:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveNotification:) name:[[[BlueShift sharedInstance] config] blueShiftNotificationName] object:nil];
Note: This should be executed only after initialising the Blueshift config in the app delegate.
To implement the notification, and then remove the observer:
-
(void) receiveNotification:(NSNotification *) notification {
NSDictionary *userInfo = notification.userInfo;
NSNumber *numObj = [userInfo objectForKey:[[[BlueShift sharedInstance] config] isEnabledPushNotificationKey]];
if ([numObj boolValue]){
printf("Permission given");
}else {
printf("Permission denied");
}
[[NSNotificationCenter defaultCenter] removeObserver:self name:[[[BlueShift sharedInstance] config] blueShiftNotificationName] object:nil];
}
Note: This notification is also triggered every app launch after the user is asked for permission and can be used to know the status of push notification permission status every app launch.