In my app main activity doesn't open when the user taps on the notification
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="mx.com.eluniversal.test.pruebapushtags">
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="17" />
<permission android:name="mx.com.eluniversal.test.pruebapushtags.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="mx.com.eluniversal.test.pruebapushtags.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application android:allowBackup="true" android:icon="#mipmap/ic_launcher" android:label="#string/app_name" android:theme="#style/AppTheme">
<activity android:name="mx.com.eluniversal.test.pruebapushtags.ActivityPrincipal" android:label="#string/app_name" android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="mx.com.eluniversal.test.pruebapushtags.ActivityPrincipal.NOTIFICATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.worklight.wlclient.ui.UIActivity" />
<service android:name="com.worklight.wlclient.push.GCMIntentService" />
<receiver android:name="com.worklight.wlclient.push.WLBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="mx.com.eluniversal.test.pruebapushtags" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="mx.com.eluniversal.test.pruebapushtags" />
</intent-filter>
</receiver>
</application>
</manifest>
It doesn't open if the app is on the background and doesn't update the information in the activity while in the foreground when a new push notification arrives.
You can take a look at the following Native Android sample application that demonstrates implementing Tag-based push notifications: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-0/notifications/push-notification-native-android-applications/tag-based-notifications/
Compare its files with yours (AndroidManifest.xml, strings.xml, ...).
Since you are not responding in the comments, that's the best that can be done at this time.
Note: This application is based on MobileFirst Platform 7.0, so you cannot open the project file in previous releases. However, you can still extract the .zip file and look at the source files from the file system.
Related
I am new on Xamarin and android. I am facing issue with my Xamarin Android app. The application is get crashed. when it closed and received a GCM notification from the server. I have applied many configurational changes and update the Manifest.
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.packageName.permission.C2D_MESSAGE" />
<permission android:name="com.packagename.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<application android:icon="#drawable/logo" android:label="AppName">
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="myKey" />
<supports-screens android:xlargeScreens="true" />
<receiver android:name="com.packagename.PushHandlerService"></receiver>
<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" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.packagename" />
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="air.com.packagename.gcm"/>
</intent-filter>
</receiver>
</application>
Here is the Error Log: PushNotificationRegistationIntentService - Register -
Java.IO.IOException: MISSING_INSTANCEID_SERVICE
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c].
I have fixed this issue. I create IntentService instead of Service. https://developer.android.com/reference/android/app/IntentService.html
And I found an example for Intent service: https://developer.xamarin.com/samples/monodroid/RemoteNotifications/
Error : Device token Field always null in Parse Installation table.
code
java
ParseInstallation.getCurrentInstallation().saveInBackground();
ParsePush.subscribeInBackground(AppConfig.PARSE_CHANNEL, new SaveCallback() {
#Override
public void done(ParseException e) {
Log.e(TAG, "Successfully subscribed to Parse!");
}
});
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dev.leapup" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!--
IMPORTANT: Change "com.parse.tutorials.pushnotifications.permission.C2D_MESSAGE" in the lines below
to match your app's package name + ".permission.C2D_MESSAGE".
-->
<permission android:protectionLevel="signature"
android:name="com.dev.leapup.pushnotifications.permission.C2D_MESSAGE" />
<uses-permission android:name="com.dev.leapup.pushnotifications.permission.C2D_MESSAGE" />
<application
android:name=".application.LeapUpApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".services.LeapUpService"
android:exported="false" >
</service>
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<!--
IMPORTANT: Change "com.parse.tutorials.pushnotifications" to match your app's package name.
-->
<category android:name="com.dev.leapup.pushnotifications" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
<!-- replace #drawable/push_icon with your push icon identifier -->
<meta-data android:name="com.parse.push.notification_icon" android:resource="#drawable/ic_launcher"/>
</application>
Interesting fact is if use same java code in another project it works, generate the devicetoken. what is the reason, not generating devicetoken for this project , manifest problem?? anything need to change manifest? please help me.
your package name appears to be "com.dev.leapup" however you are incorrectly entering it as "com.dev.leapup.pushnotifications" in your manifest.
as per the comment from Parse
<!--
IMPORTANT: Change "com.parse.tutorials.pushnotifications.permission.C2D_MESSAGE" in the lines below
to match your app's package name + ".permission.C2D_MESSAGE".
-->
You should install Google App for having device-token in your device...
it helped me with old devices and genymotion emulator....
see tutorial on Github
see answer on StackOverFlow
Hope this will helps you and others...
I am attempting to set up push notifications for my application. I have followed the appropriate quickstart guide and the tutorial and have, as far as I can tell, set everything up correctly, but when I run the app I get the following LogCat error:
E/com.parse.ManifestInfo(17775): Cannot use GCM for push because the app manifest is missing some required declarations. Please make sure that these permissions are declared as children of the root <manifest> element:
E/com.parse.ManifestInfo(17775): <uses-permission android:name="android.permission.INTERNET" />
E/com.parse.ManifestInfo(17775): <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
E/com.parse.ManifestInfo(17775): <uses-permission android:name="android.permission.VIBRATE" />
E/com.parse.ManifestInfo(17775): <uses-permission android:name="android.permission.WAKE_LOCK" />
E/com.parse.ManifestInfo(17775): <uses-permission android:name="android.permission.GET_ACCOUNTS" />
E/com.parse.ManifestInfo(17775): <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
E/com.parse.ManifestInfo(17775): <permission android:name="com.example.myapp.permission.C2D_MESSAGE" android:protectionLevel="signature" />
E/com.parse.ManifestInfo(17775): <uses-permission android:name="com.example.myapp.permission.C2D_MESSAGE" />
E/com.parse.ManifestInfo(17775): Also, please make sure that these services and broadcast receivers are declared as children of the <application> element:
E/com.parse.ManifestInfo(17775): <service android:name="com.parse.PushService" />
E/com.parse.ManifestInfo(17775): <receiver android:name="com.parse.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
E/com.parse.ManifestInfo(17775): <intent-filter>
E/com.parse.ManifestInfo(17775): <action android:name="com.google.android.c2dm.intent.RECEIVE" />
E/com.parse.ManifestInfo(17775): <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
E/com.parse.ManifestInfo(17775): <category android:name="com.example.myapp" />
E/com.parse.ManifestInfo(17775): </intent-filter>
E/com.parse.ManifestInfo(17775): </receiver>
Here's the relevant excerpt from my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<permission android:name="com.example.myapp.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.myapp.permission.C2D_MESSAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<!-- activities excluded to be concise -->
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example.myapp" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.parsePushBroadcastReceiver"
android:exported="false" >
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
<meta-data
android:name="com.parse.push.notification_icon"
android:resource="#drawable/push_icon" />
</application>
</manifest>
I've double and triple checked and it seems like I have everything that the error is saying I need. Is there something obvious that I'm missing here?
Other possibly relevant information:
My launcher activity
public class StartActivity extends ActionBarActivity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Parse.initialize(this, "REDACTED", "REDACTED");
ParsePush.subscribeInBackground("");
ParseUser user = ParseUser.getCurrentUser();
Intent i;
if (user == null) {
i = new Intent(this, LogInActivity.class);
} else {
i = new Intent(this, MainActivity.class);
}
startActivity(i);
finish();
}
}
There is not currently anything related to pushes in any of my other classes. One possibility I haven't tested yet is that my lack of a ParsePushBroadcastReceiver subclass is causing a problem, but based on the documentation in the Parse API, this doesn't seem to be necessary for the basic push service.
My full manifest, in case it's needed:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<permission android:name="com.example.myapp.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.myapp.permission.C2D_MESSAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".LogInActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name=".ChatActivity"
android:label="#string/app_name"
android:windowSoftInputMode="stateHidden" >
</activity>
<activity
android:name=".StartActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example.myapp" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.parsePushBroadcastReceiver"
android:exported="false" >
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
<meta-data
android:name="com.parse.push.notification_icon"
android:resource="#drawable/push_icon" />
</application>
</manifest>
I'll happily provide any more information that's requested, this is all I could think of. Thanks in advance for any help.
Welp. After all the time I spent on this, it turns out I was just another victim of a typo. Although, I don't actually know what the typo was... I ended up just copy+pasting the error log into my manifest and erasing the timestamp (leaving just the suggested code) and using that to replace the relevant lines. I still can't see a difference, but it's working now. I feel pretty ridiculous.
I've got a WakefulReceiver and an IntentService set up for push notifications, just the way they are shown in the GCM tutorial.
I've gotten the notifications without issue in most devices version on Android versions 4.1.x and up (.2, .3, .4) no problem.
However on version 4.0.3 my wakeful receiver is not even firing. I've gone over the permissions since that's what I've seen on the net, but I've thrice checked the permissions and they seem to be fine.
Is there a known issue with 4.0.3 or some other lead?
Here's my Android manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.companyname.mobile.appname"
android:versionCode="1"
android:versionName="0.2" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<permission
android:name="com.companyname.appname.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.companyname.appname.permission.C2D_MESSAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/myLauncherIcon"
android:label="#string/launcher_name"
android:largeHeap="true"
android:logo="#drawable/myLogo"
android:theme="#style/Theme.MyAppTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.companyname.appname.activity.LoginActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="#android:style/Theme.Holo.Light.NoActionBar"
android:windowSoftInputMode="stateHidden|adjustResize" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.companyname.appname.activity.HomeActivity"
android:configChanges="keyboardHidden"
android:windowSoftInputMode="stateHidden" >
</activity>
<receiver
android:name="com.companyname.appname.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.companyname.appname" />
</intent-filter>
</receiver>
<service android:name="com.companyname.appname.GcmIntentService" />
</application>
I have a problem I`m just not getting any GCM Messages. I dont want Pop Ups or sounds playing, it doesnt even fire the onReceive() Method in the Broadcast Reciever, which is, to my understanding, the first point the Application handles a message.
My biggest problem is I dont get any error messages or Hints. When I send a message, I get the message ID, a multicast ID and a "success=1" message. I also get a "Device registrated on any device and a Reg ID, a "already registered" running the app a second time. The Devices are also logged into Google Play, same account as on the Google API Console. But nothing happens on the Device when I send a GCM Message.
I post my complete android manifest, please let me know if you need more code. This is driving my crazy.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lottoapplicationandroid"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto"
>
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="9" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:resizeable="true"
android:anyDensity="true" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<permission android:name="com.lottoapplicationandroid.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.lottoapplicationandroid.permission.C2D_MESSAGE" />
<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- ZXing activities -->
<activity android:name="com.google.zxing.client.android.CaptureActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="com.phonegap.plugins.barcodescanner.SCAN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name="com.google.zxing.client.android.encode.EncodeActivity" android:label="#string/share_name">
<intent-filter>
<action android:name="com.phonegap.plugins.barcodescanner.ENCODE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.lottoapplicationandroid" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
</application>
EDIT
I dont need a solution for this if not possible. I´d be very thankful for hints how to find out what`s going wrong. E.g. I found out I have to have an open Port 5228. Does anybody know how to check if the devices is listening on that port?
The Issue is solved.
I had to turn Wi-Fi off.
WiFi / Telephone-Network
off / off : not working
on / off : not working
on / on : not working
off / on : working
Aren't you missing some intent filters for the receiver ?
<receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.lottoapplicationandroid" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.lottoapplicationandroid" />
</intent-filter>
</receiver>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="packagename.permission.C2D_MESSAGE" />
<receiver
android:name=".MyBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="packagename" />
</intent-filter>
</receiver>
<service android:name="Packagename.MyIntentService" >
</service>
Try it hope so it works.