sefidgaran / salesforce-marketing-cloud

Salesforce Marketing Cloud MobilePush Flutter SDK
https://pub.dev/packages/sfmc_plugin
MIT License
6 stars 21 forks source link

Notifications are received on Android but not on iOS #16

Closed ifelsebreak closed 8 months ago

ifelsebreak commented 8 months ago

We set up the plugin for iOS with the .p8 cert.

In the Marketing Cloud console the device is registered correctly and the opt-in status is set to active. When we try to send a test notification our Android device receives the notification but the iOS device doesn't.

We tried re-creating and re-uploading the .p8 cert but the problem persists.

We noticed that upon app inizialization we get this warning:

MarketingCloudSDK+Base.m line: 319 "No notification UserInfo: - either it should be a direct launch or Notification userInfo is not available when launched from notification"

Thanks in advance!

ifelsebreak commented 8 months ago

We were able to fix our problem.

Setting up the APNS app and .p8 certificate isn't enough to receive notifications on iOS, you also have to create an iOS Firebase app in your Firebase project and, under project settings > cloud messaging, paste the senderID in the iOS app settings section (be sure to use Chrome because the iOS settings section under Cloud Messaging wasn't visible in Firefox).

This isn't explicitly explained in the read me on pub.dev and GitHub, nor in the Marketing Cloud documentation.

I think this could be added in the set up guide for sfmc_plugin.

Closing the issue.