0

I am using react-native-push-notification library to send local notifications from my ios app. I have setup deeplink using react navigation. I have also managed the local push notification to deeplink into specific app screen on click. But this requires me to set the in the message property. This means the resulting lo shows the URL in its display. This is ugly and I would like to hide the URL. Any pointers?

Here is how i schedule local notification

        PushNotification.localNotificationSchedule({
        title: "main title",
        subtitle: "fake sub title",
        message: "example://detail/one",
        bigText: "My big text that will be shown when expanded",
        date: new Date(Date.now() + 10 * 1000),
        allowWhileIdle: false,
        });

Here is my onNotification code

  onNotification: function (notification) {
    console.log("NOTIFICATION:", notification);

    let isClicked = notification.data.userInteraction === 1
    if (isClicked) {
      Linking.openURL(notification.message)
    }

    notification.finish(PushNotificationIOS.FetchResult.NoData);
  },

Now this results in the example://detail/one url being displayed in notification. How do i achieve this?

broun
  • 2,483
  • 5
  • 40
  • 55

1 Answers1

0

Not exactly a solution to the above issue. But I switched to Notifee for local push notifications. And it just worked! So much easier to install and very minimal configuration needed. Was just an intuitive I expected the notification library to be.

broun
  • 2,483
  • 5
  • 40
  • 55