iOS SDK 15.6.7,
Android SDK 15.5.3,
Hello Screen Dynamic States,
Bluedot Cordova plugin 4.0.1,
Bluedot Xamarin Android wrapper 15.5.2,
Bluedot Xamarin iOS wrapper 15.6.6,
Bluedot React Native wrapper 2.3.0,
To add Firebase to your app, you will need to create a Firebase project and a Firebase configuration file. This can be achieved with the steps documented here.
Disable Firebase method swizzling by following the steps documented here.
Once you have disabled method swizzling, you’ll need to explicitly map your APNs token to the FCM registration token. This can be achieved with the steps documented here.
If you wish to test APNS in a sandbox environment, you should map your token with the type FIRMessagingAPNSTokenTypeSandbox
// To test with Sandbox Account [[FIRMessaging messaging] setAPNSToken:deviceToken type:FIRMessagingAPNSTokenTypeSandbox];
Information on setting the Firebase Server key for your Canvas project is here.
To receive Real-time Push Notification, you need to connect Point SDK with Firebase Service by uploading Firebase Server key to Canvas web interface and subscribe the topic with Bluedot Project ID.
To make sure that push notification will be delivered to your applications which is using specific Bluedot Project. Your client app needs to subscribe to the topic with Bluedot Project ID. The FIRMessaging class handles topic messaging functionality.
Also, your client needs to first register your app with both APNs and FCM to ensure that it can receive notifications.
To subscribe to a topic, implement the didReceiveRegistrationToken method in FIRMessagingDelegate Protocol.
- (void)messaging:(FIRMessaging *)messaging didReceiveRegistrationToken:(NSString *)fcmToken { NSLog(@"Subcribing to Topic..."); NSString *topic = [NSString stringWithFormat:@"%@", ProjectId]; [[FIRMessaging messaging] subscribeToTopic: topic]; }
This makes an asynchronous request to the FCM backend and subscribes the client to the given topic. If the subscription request fails initially, FCM retries until it can subscribe to the topic successfully.
When your client app has received the Real-time Push Notification, you need to pass the userInfo from the notification as a parameter to the method notifyPushUpdateWithData:
from BDLocationManager:
- (void)notifyPushUpdateWithData: (NSDictionary *)data;
Put the method in UNUserNotificationCenterDelegate userNotificationCenter:willPresentNotification:withCompletionHandler:
to handle notifications received when the client app is in the foreground. The message is a UNNotificationobject. Implement FIRMessagingDelegate applicationReceivedRemoteMessage: to handle all data messages that are sent to the client. The message is a FIRMessagingRemoteMessage object.
// Receive displayed notifications #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 - (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler { NSDictionary *userInfo = notification.request.content.userInfo; [BDLocationManager.instance notifyPushUpdateWithData:userInfo]; ... } // Receive data message - (void)applicationReceivedRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage { [BDLocationManager.instance notifyPushUpdateWithData:[remoteMessage appData]]; ... } #endif
Point SDK will only utilize data of push notification sent with unique identifier confirming whether it is a Bluedot data, and will ignore any other data received which does not contain Bluedot’s unique identifier.