Integrating with other Push SDKs
If your game integrates with other SDKs which send push notifications and require custom notification handling, you will need to make some modifications to your integration to ensure that both Teak and your other SDKs function as expected.
iOS
On iOS, Teak will automatically intercept calls to any configured UNUserNotificationCenterDelegate
on [UNUserNotificationCenter currentNotificationCenter]
. Teak will
handle the notification, if it was sent by Teak, before invoking your delegate code.
You can confirm that this is working by observing the PostLaunchSummary and confirming that the launch is attributed to a notification when launching the game by tapping on a Teak notification.
In the unlikely event that this does not automatically work, you will need to add additional code to your implementation of userNotificationCenter:didReceiveNotificationResponse:withCompletetionHandler
Class teak = NSClassFromString(@"Teak");
if([teak isTeakNotification:response.notification]) {
[teak didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
return;
}
Class teak = NSClassFromString(@"Teak");
if([teak isTeakNotification:notification]) {
[teak willPresentNotification:response withCompletionHandler:completionHandler];
return;
}
Android
On Android you will need to implement a custom service that extends FirebaseMessagingService and override onMessageReceived
.
In your custom onMessageReceived
if (io.teak.sdk.push.FCMPushProvider.isTeakNotification(remoteMessage)) {
io.teak.sdk.push.FCMPushProvider.onMessageReceivedExternal(remoteMessage, getApplicationContext());
return;
}
You can confirm that this is working by verifying that notifications sent by all of your providers, including Teak, are correctly displayed on a test device.