-
Notifications
You must be signed in to change notification settings - Fork 100
Description
So I have read through various issues and tried various solutions, but now its finally time to create an account and ask for help.
I am currently using Phonegap 6.5.0 and desperately trying to get push notifications to work.
below is the debug from logcat when the app crashes. As a note it does work on IOS, I do have a feeling its because ParsePushApplication.java is not called? But I have only been working woth phonegap/cordova for a week or so and am very noob :)
2019-04-26 09:57:57.291 11326-11573/com.phonegap.helloworld E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-2
Process: com.phonegap.helloworld, PID: 11326
java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File com.parse.ParsePlugins.getParseDir()' on a null object reference
at com.parse.ParseCorePlugins.getCurrentInstallationController(ParseCorePlugins.java:273)
at com.parse.ParseInstallation.getCurrentInstallationController(ParseInstallation.java:53)
at com.parse.ParseInstallation.getCurrentInstallation(ParseInstallation.java:59)
at github.taivo.parsepushplugin.ParsePushPlugin$1.run(ParsePushPlugin.java:88)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Here is the html
`
<title>Blank App</title> <script type="text/javascript" src="cordova.js"></script> <script type="text/javascript">
window.onload = onLoad();
function onLoad() {
document.writeln("Waiting for device ready");
document.addEventListener("deviceready", onDeviceReady, false);
}
// device APIs are available
//
function onDeviceReady()
{
document.writeln("device Ready");
// Now safe to use device APIs
// onLoad();
pushFunctions();
}
function pushFunctions()
{
if(window.ParsePushPlugin){
document.writeln("Get installation ID");
window.ParsePushPlugin.getInstallationId(function(id) {
// note that the javascript client has its own installation id,
// which is different from the device installation id.
document.writeln("device installationId: " + id);
// alert("device installationId: " + id);
}, function(e) {
// alert('error');
document.writeln("device installationId: error");
});
}
else
{
document.writeln("window.ParsePushPlugin error");
}
}
</script>
</body>
`
TEST
A blank PhoneGap app.
PhoneGap Team
<platform name="android">
<preference name="android-minSdkVersion" value="15" />
<preference name="android-targetSdkVersion" value="28" />
</platform>