Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
110 stars 139 forks source link

"Alert: Attempt to invoke virtual method.." #151

Closed verdio closed 8 years ago

verdio commented 8 years ago

Hi,

I am using Phone Gap Build with Pushwoosh plugin:

The messages are being sent correctly, and "actions" are working, but when I launch the my app I am getting this "Alert" dialogue and do not know how to correct the situation.

Here is the full alert (it appears on launch of the app only):

"Alert Attempt to invoke virtual method 'void com.arellomobile.android.push.PushManager.registerForPushNotifications()' on a null object reference"

Thoughts?

Mark

shaders commented 8 years ago

Please specify which plugin version do you use? It looks like the plugin is outdated, the package name has been changed in the latest SDK.

verdio commented 8 years ago

was what I used.

On Mon, Jan 18, 2016 at 6:42 AM, shaders notifications@github.com wrote:

Please specify which plugin version do you use? It looks like the plugin is outdated, the package name has been changed in the latest SDK.

— Reply to this email directly or view it on GitHub https://github.com/Pushwoosh/pushwoosh-phonegap-plugin/issues/151#issuecomment-172518269 .

DimanAM commented 8 years ago

https://build.phonegap.com/plugins/1297 is deprecated.

The correct way of including plugin is:

<gap:plugin name="pushwoosh-pgb-plugin" source="npm" /> <preference name="android-build-tool" value="gradle" />

verdio commented 8 years ago

Do I also need some javascript somewhere to initialize the plugin, etc ???

DimanAM commented 8 years ago

Just follow this guide http://docs.pushwoosh.com/docs/phonegap-build There is also a sample https://github.com/Pushwoosh/phonegap-build-sample-app