(solved) Doc missing part

The Enteprise doc is missing the manifest part. Here is what is there:

Also add the following in the AndroidManifest.xml file in the \<mainifest\> section replacing com.mycompany.app with your packagename. (http://forums.coronalabs.com/forum/640-gamethrive/) ``````xml ``````

http://docs.coronalabs.com/daily/plugin/GameThrivePushNotifications/CoronaEnterprise.html

Thanks for reporting this. Here is the missing AndroidManifest.xml file contains you need to add. Replace “com.mycompany.app” with your package name.
 

\<permission android:name="com.mycompany.app.permission.C2D\_MESSAGE" android:protectionLevel="signature"/\> \<uses-permission android:name="com.mycompany.app.permission.C2D\_MESSAGE"/\> \<uses-permission android:name="android.permission.INTERNET"/\> \<uses-permission android:name="android.permission.VIBRATE"/\> \<supports-screens android:anyDensity="true"/\> \<!--library--\> \<uses-permission android:name="android.permission.READ\_PHONE\_STATE"/\> \<!-- 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"/\> \<!-- This app has permission to register and receive data message. --\> \<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/\>

The fix to the page will take effect in the next few days.

Nice.

One question: Are all these permission really necessary?  Like, specially the READ_PHONE_STATE,  GET_ACCOUNTS and WAKE_LOCK ?

Hi Renato,

READ_PHONE_STATE is used to get an identifier for the device so we can track a user between your apps. For instance, to provide features like sending a notifications from two of your apps, but only delivering it once to users that have both apps installed. It’s optional though, so you can remove it if you prefer.

GET_ACCOUNTS is required for GCM push messages to work on devices less than Android 4.0.4.

WAKE_LOCK is required to wake the device for a short time to create the notification itself on the device and play the notification sound.

Both GET_ACCOUNTS and WAKE_LOCK in regards to push messages are explained here: http://developer.android.com/google/gcm/client.html

Thanks for the link George.

I looked there and the WAVE_LOCK is also optional.  So the besides the others, I would only the GET_ACCOUNTS.

I try to not use the READ_PHONE_STATE because I get a lot of users complains about it. The name that Android uses it for it (“READ_PHONE_STATE”) is terrible and people think that my app want to read their phone (like messages, calls,…).

WAKE_LOCK is required for the device to display the notification and play a sound when the notification is received. The way GCM notifications work is that the app actually needs to wake itself up when a notification is sent so that it can push the notification into notification center.

I agree with your comment about READ_PHONE_STATE, we’ve actually decided to remove it from the next version of the plugin. But as an enterprise user you can also just manually exclude it from your manafest and things will still work. 

Thanks for reporting this. Here is the missing AndroidManifest.xml file contains you need to add. Replace “com.mycompany.app” with your package name.
 

\<permission android:name="com.mycompany.app.permission.C2D\_MESSAGE" android:protectionLevel="signature"/\> \<uses-permission android:name="com.mycompany.app.permission.C2D\_MESSAGE"/\> \<uses-permission android:name="android.permission.INTERNET"/\> \<uses-permission android:name="android.permission.VIBRATE"/\> \<supports-screens android:anyDensity="true"/\> \<!--library--\> \<uses-permission android:name="android.permission.READ\_PHONE\_STATE"/\> \<!-- 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"/\> \<!-- This app has permission to register and receive data message. --\> \<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/\>

The fix to the page will take effect in the next few days.

Nice.

One question: Are all these permission really necessary?  Like, specially the READ_PHONE_STATE,  GET_ACCOUNTS and WAKE_LOCK ?

Hi Renato,

READ_PHONE_STATE is used to get an identifier for the device so we can track a user between your apps. For instance, to provide features like sending a notifications from two of your apps, but only delivering it once to users that have both apps installed. It’s optional though, so you can remove it if you prefer.

GET_ACCOUNTS is required for GCM push messages to work on devices less than Android 4.0.4.

WAKE_LOCK is required to wake the device for a short time to create the notification itself on the device and play the notification sound.

Both GET_ACCOUNTS and WAKE_LOCK in regards to push messages are explained here: http://developer.android.com/google/gcm/client.html

Thanks for the link George.

I looked there and the WAVE_LOCK is also optional.  So the besides the others, I would only the GET_ACCOUNTS.

I try to not use the READ_PHONE_STATE because I get a lot of users complains about it. The name that Android uses it for it (“READ_PHONE_STATE”) is terrible and people think that my app want to read their phone (like messages, calls,…).

WAKE_LOCK is required for the device to display the notification and play a sound when the notification is received. The way GCM notifications work is that the app actually needs to wake itself up when a notification is sent so that it can push the notification into notification center.

I agree with your comment about READ_PHONE_STATE, we’ve actually decided to remove it from the next version of the plugin. But as an enterprise user you can also just manually exclude it from your manafest and things will still work.