Closed lorenc-tomasz closed 3 years ago
For me it's not working at all. When implementing my own NotificationService I am able to receive Rich push notification when directly sending push to APNS with 'mutable-content': 1. With MP implementation by sub-classing NotificationService with MPNotificationServiceExtension I'm only able to receive simple title + body. I'm always using https images.
Ok guys after few hours of debugging I found that MP checking image extension inside URL, so you should use images url's like this: https://host.com/some_image.jpg. @lorenc-tomasz for me its also not working in background state. Also I think their image uploader doesn't work well.
@lorenc-tomasz off topic (didn't found your email), big thx for fixing alias on react-native-mixpanel, you saved me a lot of time and saved us a lot of money for duplications of thousands people profiles in MP. :) (noticed your PR to that library few minutes ago)
Have you perhaps overridden didReceiveRemoteNotification
with something that causes a non-rich alert to be shown? Can you share your didReceiveRemoteNotification
implementation from your AppDelegate (if you did override it)?
@jbwyme
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler {
[[RNFirebaseNotifications instance] didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
[RCTPushNotificationManager didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
I am experiencing this as well, and I think I've found the issue. If you follow the directions and use an empty class that inherits from MPNotificationServiceExtension, the following code is executed, which checks for a userInfo["mp"] key/value pair and returns the original content if it doesn't exists. This means you can't process a rich push from your server.
(void)didReceiveNotificationRequest:(UNNotificationRequest )request withContentHandler:(void (^)(UNNotificationContent _Nonnull))contentHandler { NSLog(@"%@ MPNotificationServiceExtension didReceiveNotificationRequest", self);
if (![Mixpanel isMixpanelPushNotification:request.content]) { NSLog(@"%@ Not a Mixpanel push notification, returning original content", self); contentHandler(request.content); return; }
Here's a workaround: from your server, add the following as the APNS "data" field: {"mp_media_url": link_to_your_image, "mp": {}}. This "tricks" the mixpanel handler into thinking its coming from the mixpanel console.
Mixpanel is deprecating Messaging and Mobile A/B testing features(more details), please contact our support if you need to continue the conversation for any critical issues. Sorry for the inconvenience.
Integration Method: CocoaPods Xcode Version: 11.3.1 Library Version: 3.6.0 Platform: iOS and NotificationSerice Language: Objective-C Description: When I send rich notifications with e.g. button that opens the website it works only when app is closed. When app is in foreground or background app gets only Title and body. Expected Behavior: Rich notification should work when app is in foreground and background.