I’m registering my device ob backendless but it gave error java.lang.RuntimeException: Could not register device on Backendless server: Permission denied (missing INTERNET permission?) however i have also added INTERNET and ACCESS_NETWORK_STATE permissions in manifest file. i don’t know why it gave error. first it Toast “registered” then the application stopped working. kindly help me here
the permissions are
<user-permission android:name=“android.permission.INTERNET” />
<user-permission android:name=“android.permission.ACCESS_NETWORK_STATE” />
<uses-permission android:name=“android.permission.WAKE_LOCK”/>
<uses-permission android:name=“com.google.android.c2dm.permission.RECEIVE”/>
<uses-permission android:name=“com.example.mubtadanaqvi.backendlesstutorial.permission.C2D_MESSAGE”/>
here is my java file code
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Backendless.initApp(this,AppKey,SecretKey,Version);
Backendless.Messaging.registerDevice(gcmSenderID, "default", new AsyncCallback<Void>() {
@Override
public void handleResponse(Void response) {
Toast.makeText(getBaseContext(),"Registered", Toast.LENGTH_SHORT).show();
}
@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText(getBaseContext(),"fault: "+fault.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}