Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS addOnBackgroundMessage and addOnMessage not working #48

Open
a1ssat opened this issue Jan 25, 2024 · 1 comment
Open

iOS addOnBackgroundMessage and addOnMessage not working #48

a1ssat opened this issue Jan 25, 2024 · 1 comment

Comments

@a1ssat
Copy link

a1ssat commented Jan 25, 2024

xcrun simctl push booted com.app.app push.json
{
  "aps": {
    "alert": {
      "title": "Test",
      "body": "hello message"
    }
  }
}

onInit(){

Push.instance.addOnMessage((message) {
      log('RemoteMessage received while app is in foreground:\n'
          'RemoteMessage.Notification: ${message.notification} \n'
          ' title: ${message.notification?.title.toString()}\n'
          ' body: ${message.notification?.body.toString()}\n'
          'RemoteMessage.Data: ${message.data}');
      showMaterialBanner(message.toString());
    });

    Push.instance.addOnBackgroundMessage((message) {
      log('RemoteMessage received while app is in background:\n'
          'RemoteMessage.Notification: ${message.notification} \n'
          ' title: ${message.notification?.title.toString()}\n'
          ' body: ${message.notification?.body.toString()}\n'
          'RemoteMessage.Data: ${message.data}');
      _showMaterialBanner(message.toString());
    });


}
@ben-xD
Copy link
Owner

ben-xD commented Jan 26, 2024

There's not enough information here yet.

  • can you explain what's happening?
  • What version of push are you using?
  • Can you try using the send_ios.sh tool and see if that works?
    # iOS tools for push notifications

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants