Closed ghost closed 8 years ago
Also AndroidManifest.xml seems correct: file location : platforms\android\build\intermediates\manifests\full\push-plugin\debug
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
And
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.pushApp.gcm" />
</intent-filter>
</receiver>
<service
android:name="com.telerik.pushplugin.PushPlugin"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
We're probably not the best people to ask about errors in somebody else's code. You'll get better and more targeted help if you open an issue with the authors of the code/plugin you're using. Thanks for your understanding!
Hi, I am trying something on NativeScript for push notification on android and am getting push notification at the top of android phone(notification area), but when I click on the notification my app opens but the alert written in code is not shown,also error is thrown in console.
There are 2 parts to it. 1) This error needs to be solved. 2) I need to handle click event of notification in my application , like show a dialog, asking OK/Cancel.
I have got this code from github only(https://github.com/NativeScript/push-plugin). Can someone please find error I am doing .Code is as follows `var pushPlugin = require("nativescript-push-notifications"); var settings = { // Android settings senderID: '539XXXXXXX38', // Android: Required setting with the sender/project number notificationCallbackAndroid: function(message) { // Android: Callback to invoke when a new push is received. alert("JSON.stringify(message)");
},
Error getting on console: I/dalvikvm(14721): Could not find method org.json.JSONObject.wrap, referenced fr om method com.telerik.pushplugin.PushPlugin.executeOnMessageReceivedCallback W/dalvikvm(14721): VFY: unable to resolve static method 55897: Lorg/json/JSONObj ect;.wrap (Ljava/lang/Object;)Ljava/lang/Object;