GCMIntentService won't run on android 2.3.4 - android

I'm on Google clouding message app that works on 4+ android devices. but the GCMIntentService
service wont run on my sony xperia arc that have android 2.3 and so it will not register to GCM. I also should say that my xperia arc is rooted. is rooting the problem? my project is customization of this link
I creates check points in GCMIntentService but it wont run at all.
this is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mypackagename" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="21" />
<permission
android:name=".permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name=".permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.VIBRATE" />
<!-- 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" />
<!-- Creates a custom permission so only this app can receive its messages. -->
<uses-permission android:name="com.mypackagename.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive data message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- Network State Permissions to detect Internet status -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- mahdi comments: for registration of reciver for GCM -->
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:name=".global.G">
<activity
android:name=".ui.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.mypackagename" />
</intent-filter>
</receiver>
<service android:enabled="true" android:name="com.mypackagename.GCMIntentService" />
</application>
</manifest>

Related

GCMRegistrar.register issue in Android Studio

I am trying to integrate Push notifications with android project in Android Studio, using tutorial from here (even though it's for eclipse).
When i call GCMRegistrar.register(this, SENDER_ID), nothing happens. I read about this, and maybe it is a problem somewhere in the AndroidManifest. It never goes to onRegister in GCMIntentService class. How to solve this issue?
Here are some parts of the manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<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="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- This app has permission to register and receive data message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="xx.xxxxxx.android.jimba.XxXx.permission.C2D_MESSAGE" />
<!-- Creates a custom permission so only this app can receive its messages. -->
<permission
android:name="xx.xxxxxx.android.jimba.XxXx.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<permission
android:name="xx.xxxxxx.android.jimba.XxXx.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="xx.xxxxxx.android.jimba.XxXx.permission.MAPS_RECEIVE" />
.
.
.
<activity
android:name="xx.xxxxxx.android.ActivityLogin"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" >
</activity>
.
.
.
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="xx.xxxxxx.android" />
</intent-filter>
</receiver>
<service android:name="xx.xxxxxx.android.GCMIntentService" />
P.S. I already made one application with push notifications in Eclipse, but this is different project and different IDE, so server side is OK.
The tutorial you're following is outdated. Use google's.

Play Store reports APK not designed for tablets, all permissions set as not required

Every solution I've seen on here for this problem just involved writing "androidrequired="false"" after each uses-permission that may not be avaliable on a tablet. I did this for every single uses-permission in my manifest (alot, I know), but still getting the "Your APK should only require hardware features that are usually available on tablets" on the Google Play publisher's console, and tablets are still unable to download my application. What's causing this?
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp.app"
android:versionCode="21"
android:versionName="1.01R" >
<!-- My App requires Android APK Level 16 (4.1) or above -->
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="24" />
<!-- GCM connects to Internet Services. -->
<uses-permission android:name="android.permission.INTERNET" android:required="false" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" android:required="false" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" android:required="false" />
<!-- Creates a custom permission so only this app can receive its messages. -->
<permission
android:name="com.myapp.app.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.myapp.app.permission.C2D_MESSAGE" android:required="false" />
<!-- This app has permission to register and receive data message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" android:required="false" />
<!-- Network State Permissions to detect Internet status -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" android:required="false" />
<!-- Core function permissions -->
<uses-permission android:name="android.permission.CALL_PHONE" android:required="false" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" android:required="false" />
<uses-permission android:name="android.permission.VIBRATE" android:required="false" />
<uses-permission android:name="android.permission.CAMERA" android:required="false" />
<uses-permission android:name="android.hardware.camera" android:required="false" />
<uses-permission android:name="android.permission.READ_CONTACTS" android:required="false" />
<uses-permission android:name="android.permission.READ_SMS" android:required="false"/>
<uses-permission android:name="android.permission.READ_CALL_LOG" android:required="false" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:required="false" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:required="false" />
<uses-permission android:name="android.permission.FLASHLIGHT" android:required="false" />
<uses-permission android:name="android.permission.SEND_SMS" android:required="false" />
<uses-permission android:name="android.permission.WRITE_SMS" android:required="false" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" android:required="false" />
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" android:required="false" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" android:required="false" />
<uses-permission android:name="android.permission.RECORD_AUDIO" android:required="false" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:required="false" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" android:required="false" />
<!-- Main activity. -->
<application
android:icon="#drawable/newlogo2"
android:label="#string/app_name"
android:allowBackup="false"
>
<!-- Google Play Services Library. -->
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<!-- Register Activity -->
<activity
android:name="com.myapp.app.RegisterActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Main Activity -->
<activity
android:name="com.myapp.app.MainActivity"
android:configChanges="orientation|keyboardHidden"
android:label="#string/app_name" >
</activity>
<!-- Google Cloud Messaging Receiver -->
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.myapp.app" />
</intent-filter>
</receiver>
<!-- Device Administration Receiver -->
<receiver
android:name="com.myapp.app.DeviceAdmin"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data android:name="android.app.device_admin"
android:resource="#xml/device_admin" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
<action android:name="android.app.action.ACTION_DEVICE_ADMIN_DISABLE_REQUESTED" />
<action android:name="android.app.action.ACTION_DEVICE_ADMIN_DISABLED" />
</intent-filter>
</receiver>
<!-- GCM Heartbeat Alarm Receiver -->
<receiver
android:name="com.myapp.app.GCMHeartbeatAlarm"
android:permission="com.google.android.c2dm.permission.SEND"
android:process=":remote">
</receiver>
<!-- Receiver called on successful device reboot -->
<receiver android:name="com.myapp.app.BootReceiver"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
</intent-filter>
</receiver>
<service android:name="com.myapp.app.GCMIntentService" />
<service android:name="com.myapp.app.LocationService" />
<service android:name="com.myapp.app.AudioPlayer" />
<service android:name="com.myapp.app.SoundRecorder" />
</application>
</manifest>
Every solution I've seen on here for this problem just involved writing "androidrequired="false"" after each uses-permission that may not be avaliable on a tablet
No solutions to anything should suggest that, as there is no android:required attribute on <uses-permission>.
but still getting the "Your APK should only require hardware features that are usually available on tablets" on the Google Play publisher's console, and tablets are still unable to download my application. What's causing this?
Several of the <uses-permission> elements that you have (and, by $DEITY, you sure do have a lot of <uses-permission> elements...) imply that you need certain hardware features. For example, CALL_PHONE implies that you need the device to have telephony capability. Most tablets lack this.
For those permissions, if you are willing to get by without that hardware capability, you can add <uses-feature> elements — which can have an android:required attribute — to say that those hardware features are not required.
A table of relevant permissions, along with the corresponding implied hardware feature, can be found in the documentation.
Also, please delete:
<uses-permission android:name="android.hardware.camera" android:required="false" />
as there is no such permission.

Unable to send push notification to android phone from parse.com

I am new to android development and parse.com. I am trying to send a push notification from the web console (parse.com) to android emulator. Though I get a success on the web console but I do not receive any notification on the device. Moreover, I get this error :
`02-04 17:54:52.100 2501-2520/com.parse.starter E/com.parse.ManifestInfo﹕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:
<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" />
<permission android:name="com.parse.starter.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.parse.starter.permission.C2D_MESSAGE" />
Also, please make sure that these services and broadcast receivers are declared as children of the <application> element:
<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.parse.starter" />
</intent-filter>
</receiver>
Here's my Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.parse.starter"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
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.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!--
IMPORTANT: Change "com.parse.starter.permission.C2D_MESSAGE" in the lines below
to match your app's package name + ".permission.C2D_MESSAGE".
-->
<permission
android:name="com.parse.starter.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.parse.starter.permission.C2D_MESSAGE" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
<!--
To retrieve OAuth 2.0 tokens or invalidate tokens to disconnect a user. This disconnect
option is required to comply with the Google+ Sign-In developer policies
-->
<uses-permission android:name="android.permission.USE_CREDENTIALS" /> <!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<application
android:name=".ParseApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<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.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>
<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.starter" to match your app's package name. -->
<category android:name="com.pase.starter" />
</intent-filter>
</receiver>
</application>
</manifest>
And in my application class, I have defined this:
ParsePush.subscribeInBackground("", new SaveCallback() {
#Override
public void done(ParseException e) {
if (e == null) {
Log.d("com.parse.push", "successfully subscribed to the broadcast channel.");
} else {
Log.e("com.parse.push", "failed to subscribe for push", e);
}
}
});
Try the following:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.parse.starter"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
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.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!--
To retrieve OAuth 2.0 tokens or invalidate tokens to disconnect a user. This disconnect
option is required to comply with the Google+ Sign-In developer policies
-->
<uses-permission android:name="android.permission.USE_CREDENTIALS" /> <!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<application
android:name=".ParseApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<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.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>
<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.starter" to match your app's package name. -->
<category android:name="com.pase.starter" />
</intent-filter>
</receiver>
<!--
IMPORTANT: Change "com.parse.starter.permission.C2D_MESSAGE" in the lines below
to match your app's package name + ".permission.C2D_MESSAGE".
-->
<permission
android:name="com.parse.starter.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.parse.starter.permission.C2D_MESSAGE" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
</application>
</manifest>
I'm not in Android Studio right now so I can't test it, but I think it should work !

Android App is not visible on Google Play store for tablets

Can anyone suggest me why this app is not visible for tablets on google play store.
I am using GCM, Gmap, Camera and storing files on sdcard.
It is not visible for major tablets on google play store, sim and simless.
I do know that google play store mask app from device which not match with manifest permissions however I believe that there no any permission which is not exist on major samsung devices.
Please find below manifest.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app"
android:versionCode="15"
android:versionName="2.4.3" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="false"
android:xlargeScreens="true" />
<!-- GOOGLE CLOUD MESSAGING SECION -->
<permission
android:name="com.example.app.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.app.permission.C2D_MESSAGE" />
<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- 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" />
<!-- END GOOGLE CLOUD MESSAGING SECION -->
<permission android:name="com.example.app.permission.MAPS_RECEIVE" />
<uses-permission android:name="com.example.app.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Required OpenGL ES 2.0. for Maps V2 -->
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:allowBackup="false"
android:allowClearUserData="false"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:theme="#style/AppTheme" >
<!-- GOOGLE CLOUD MESSAGING SECION -->
<receiver
android:name="com.example.app.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.app" />
</intent-filter>
</receiver>
<service
android:name="com.example.app.GCMRegistrationService"
android:enabled="true"
android:exported="false" />
<!-- END GOOGLE CLOUD MESSAGING SECTION -->
<activity
android:name=".SplashActivity"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
If the Tablet android version below
android:minSdkVersion="11"
Then Google playstore .will not show app in the tablet

Guideliness to achieve push notification in android

I am doing Cross platform application, my current work is going on implementing push notification. I can able to see the message acknowledgment was positive from server.
MessageResult:MulticastResult(multicast_id=somenumber,total=1,success=1.failure=0.canonical_ids=0,results:[[messageID=somenumber]])
Here success=1 message was successfully pushed to GCM server but for IOS its not an issue.
Once in a while i am getting notification. I cant track in which area is going wrong either with my mobile data or GCM. Any techies have faced this scenario ?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.mobile"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="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.ACCESS_NETWORK_STATE" />
<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.WAKE_LOCK" />
<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.GET_TASKS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="com.company.mobile.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.company.mobile.permission.C2D_MESSAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.company.mobile.MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.company.mobile.ScreenOrientation" >
</activity>
<activity android:name="com.plugin.gcm.PushHandlerActivity" />
<receiver
android:name="com.plugin.gcm.CordovaGCMBroadcastReceiver"
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.company.mobile.monitor" />
</intent-filter>
</receiver>
<service android:name="com.plugin.gcm.GCMIntentService" />
</application>
</manifest>
After the couple of days i found out the issue and came up with solution. The GCM is reliable one the only problem is with device. We need to check
If you using Wi-Fi consult your network admin whether the push notification port is enable.
If you are using mobile data check the settings of the device which enable for push notification. (Settings -- > WiFi -->Data usage --> Your application(enable notification))
Need to check whether google account is properly synched. (This scenario created issue in my case)
Don't switch between mobile data and Wi-Fi.
Finally restart the device.
Some tips here

Categories

Resources