zo0r / react-native-push-notification

React Native Local and Remote Notifications
MIT License
6.76k stars 2.05k forks source link

I'm getting error when notification triggered #1566

Closed vickypathak123 closed 4 years ago

vickypathak123 commented 4 years ago

Hello,

I'm getting Following error when local notification triggered.

Possible Unhandled Promise Rejection (id: 0): Error: Unable to open URL: quotesapp://home/Every%20single%20day,%20I'm%20curious%20about%20everything.%20Curiosity%20is%20finding%20answers%20to%20things.

But, when notification triggered before that I'm get the string like this in the log :- Every single day, I'm curious about everything. Curiosity is finding answers to things.

I really don't know why string converted into URL form.

Please replay if anyone know this error solution.

Thank You

Dallas62 commented 4 years ago

Hi @vickypathak123 This error is probably not related to the library, please look to: https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/decodeURI or https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/decodeURIComponent Regards

vickypathak123 commented 4 years ago

@Dallas62

Thank You for Replay.

Yes, I'm try this solution but error not solve.

Even if when I'm pass simple string in message of notification like below :-

PushNotification.localNotificationSchedule({ //... You can use all the options from localNotifications id:"1234", vibrate: true, vibration: 300, priority: 'high', importance: 'default', message: "GEtString", date: new Date(Date.now() + 3000), repeatType:'hour', });

Then after when notification triggered then following error occur.

Possible Unhandled Promise Rejection (id: 5): Error: Unable to open URL: quotesapp://home/GEtString

Please message me if any wrong in code.

I'm waiting for your replay

Thank You

Dallas62 commented 4 years ago

Ok, but does your openURL work without notification ? I mean, if the URL is wrong/not working, it's probably not the library.

vickypathak123 commented 4 years ago

@Dallas62 Thank you for replay.

Yes, I'm pass simple string in message. But I don't know why message take as a URL. I'm not pass any type of URL in message just pass simple string message but in error show Unable to open URL: quotesapp://home/GEtString.

Please message me if I'm anything missing

Thank You

Dallas62 commented 4 years ago

Sorry @vickypathak123 But as I already said, this error is not related to this library. You are trying to open a URL that cannot be opened, check your code where you call openURL.

vickypathak123 commented 4 years ago

@Dallas62

OKay,

Thank You