phonegap-build / PushPlugin

This repository is deprecated head to phonegap/phonegap-push-plugin
https://github.com/phonegap/phonegap-plugin-push
MIT License
1.32k stars 1k forks source link

IOS PushNotification var in another page #708

Closed Lulun10 closed 7 years ago

Lulun10 commented 7 years ago

Hi,

I develop an app with push notification on IOS. I load push on load in my first page : index.html with PushNotification.init().

I want to test my push on another page, then I call PushNoticiation.hasPermission() on my notifications.html page. But in notifications.html page script stop with this call. I think plugin is not load but I test with this code without solution :

<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="myscript.js"></script>

and with :

<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="plugins/phonegap-plugin-push/www/push.js"></script>
<script type="text/javascript" src="myscript.js"></script>

Do you have an idea ?

Thank.