M
M
MotorKa2021-02-09 19:58:12
Apache Cordova
MotorKa, 2021-02-09 19:58:12

How do I open OneSignal links in the app?

Greetings. I'm making a WebView application in Cordova. Installed OneSignal plugin and Custom Scheme URL plugin.
OneSignal is a push notification, and Custom Scheme URL is a plugin that allows opening links like this : myapp://ddd/sss.html in my app only.
I've set up Pushes to come with my app's perfix, but when I click on a push notification, my app opens and that's it. I'm getting OneSignal errors in the console. I can't figure out what the problem is.

List of errors:

2021-02-09 19:34:14.717 17246-17246/ru.auto.app E/OneSignal: Error parsing JSON item 0/1 for launching a web URL.
    android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=myapp.https://site.ru/pm/Admin/ flg=0x58080000 }
        at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2014)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1675)
        at android.app.ContextImpl.startActivity(ContextImpl.java:917)
        at android.app.ContextImpl.startActivity(ContextImpl.java:888)
        at android.content.ContextWrapper.startActivity(ContextWrapper.java:379)
        at com.onesignal.OSUtils.openURLInBrowser(OSUtils.java:602)
        at com.onesignal.OSUtils.openURLInBrowser(OSUtils.java:574)
        at com.onesignal.OneSignal.openURLFromNotification(OneSignal.java:2105)
        at com.onesignal.OneSignal.handleNotificationOpen(OneSignal.java:2212)
        at com.onesignal.NotificationOpenedProcessor.processIntent(NotificationOpenedProcessor.java:116)
        at com.onesignal.NotificationOpenedProcessor.processFromContext(NotificationOpenedProcessor.java:61)
        at com.onesignal.NotificationOpenedReceiver.onReceive(NotificationOpenedReceiver.java:38)
        at android.app.ActivityThread.handleReceiver(ActivityThread.java:3380)
        at android.app.ActivityThread.access$1200(ActivityThread.java:200)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1662)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6692)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)


I've been sitting all day and I can not understand why this error.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question