Sruthin Gaddam Sruthin Gaddam - 16 days ago 5
Swift Question

Not able to display OneSignal notification as a Banner when the App is in focus :iOS

I'm using OneSignal to send device to device notifications for iOS.I'm able to send a notification to a particular device , but the if the user is inside the app it shows the notification as an alert .I want to show it as a banner . I found some documentation on "One signal regarding OSNotificationDisplayType" but I'm not able to figure out how to use it .

OneSignal.postNotification(["contents": ["en": "Test Message"], "include_player_ids": [oneSignalId]])


I need help on displaying the notification as a banner when the app is in focus

Answer

Notification will not display whenever your app is open. Notification banner will only show when your app is in background or closed.

You need to create some custom banner in order to display notification to user when your app is opened.

Comments