I'm trying to get a Xamarin.Android app to test out using of FCM for different types of communications, and I've been able to get everything set up but when i attempt to get a registration token for my Visual Studio Emulator - Android (Marshmallow), i'm getting this error..
java.lang.SecurityException: Not allowed to start service Intent {
act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms
(has extras) } without permission
com.google.android.c2dm.permission.RECEIVE 04-12 11:43:44.679
E/FirebaseInstanceId( 1793):
This is my Android.manifest - full contents out of obj\debug
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.fqtrs.xamtest" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<!--suppress UsesMinSdkAttributes-->
<uses-sdk android:minSdkVersion="16" />
<!-- This app has permission to register with GCM and receive message -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.google.android.c2dm.permission.SEND" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Required to wakeup the device and deliver messages -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission android:name="net.fqtrs.xamtest.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="net.fqtrs.xamtest.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application android:label="FCMNotifications" android:name="android.app.Application" android:allowBackup="true" android:icon="#drawable/icon" android:debuggable="true">
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" 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="net.fqtrs.xamtest" />
</intent-filter>
</receiver>
<activity android:icon="#drawable/icon" android:label="FCMNotifications" android:name="md50b8cb7a267d8690e7668352ad20476c5.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="md50b8cb7a267d8690e7668352ad20476c5.MyFirebaseIIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service android:name="md50b8cb7a267d8690e7668352ad20476c5.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<provider android:name="mono.MonoRuntimeProvider" android:exported="false" android:initOrder="2147483647" android:authorities="net.fqtrs.xamtest.mono.MonoRuntimeProvider.__mono_init__" />
<!--suppress ExportedReceiver-->
<receiver android:name="mono.android.Seppuku">
<intent-filter>
<action android:name="mono.android.intent.action.SEPPUKU" />
<category android:name="mono.android.intent.category.SEPPUKU.net.fqtrs.xamtest" />
</intent-filter>
</receiver>
<provider android:authorities="net.fqtrs.xamtest.firebaseinitprovider" android:name="com.google.firebase.provider.FirebaseInitProvider" android:exported="false" android:initOrder="100" />
<!-- FirebaseMessagingService performs security checks at runtime,
no need for explicit permissions despite exported="true" -->
<service android:name="com.google.firebase.messaging.FirebaseMessagingService" android:exported="true">
<intent-filter android:priority="-500">
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity" android:theme="#android:style/Theme.Translucent.NoTitleBar" android:exported="false" />
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
</application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
I can't figure out what is wrong with it. Anyone have any ideas?
Related
I've a Xamarin Android app and I'm trying to upload a new version on Google Play Console but I receive following error:
"Uploaded an APK which has an activity, activity alias, service or broadcast receiver with intentfilter, but without 'android : exported' property set"
Here's my androidManifest.xml file where I can see android:exported property in all tags having intent-filter child.
What's wrong in my androidManifest file or what can I do to solve this issue?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sg8.jokes" android:versionName="2.2.5" android:installLocation="auto" android:versionCode="39">
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="31" />
<application android:theme="#style/AppTheme" android:label="Barzaland" android:icon="#drawable/Icon" android:allowBackup="true" android:supportsRtl="true" android:name=".MainApplication">
<meta-data android:name="android.max_aspect" android:value="2.1" />
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<activity android:name="jokes.droid.activities.GeneralActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:launchMode="singleTop"></activity>
<activity android:name="jokes.droid.activities.ChildActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
<provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.fileprovider" android:grantUriPermissions="true" android:exported="false">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="#xml/filepaths" />
</provider>
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" 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="${applicationId}" />
</intent-filter>
</receiver>
<service android:name="jokes.droid.modules.services.FirebaseFMService" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="${applicationId}.droid.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="${applicationId}.droid.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
Whenever I build the project, it creates the manifest file again and writes it twice on the same lines.
This causes an error during build.
Every time I want to run it, I have to manually delete it and build it like that.
I tried doing clean and then rebuilding.
I deleted the obj and bin folders and tried again I get all kinds of the same error.
Any ideas?
This is AndroidManifest.xml in App.obj/App.Android/Obj/Debug/90/AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.companyname.takikuyumculuk" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" />
<uses-permission android:name="android.permission.BROADCAST_WAP_PUSH" />
<uses-permission android:name="android.permission.RECEIVE_WAP_PUSH" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Required by older versions of Google Play services to create IID tokens -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application android:name="android.app.Application" android:allowBackup="true" android:appComponentFactory="android.support.v4.app.CoreComponentFactory" android:debuggable="true" android:icon="#drawable/icon" android:label="takikuyumculuk.Android">
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" 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.companyname.takikuyumculuk" />
</intent-filter>
</receiver>
<uses-library android:name="org.apache.http.legacy" android:required="false" />
<activity android:name="crc64f5fdbb1c1efd8769.MainActivity" android:configChanges="orientation|screenSize" android:icon="#drawable/icon" android:label="TakıKuyumculuk" android:screenOrientation="portrait" android:theme="#style/MainTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="crc64f5fdbb1c1efd8769.MyFirebaseIIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service android:name="crc64f5fdbb1c1efd8769.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<receiver android:name="crc643f46942d9dd1fff9.PowerSaveModeBroadcastReceiver" android:enabled="true" android:exported="false" />
<provider android:name="mono.MonoRuntimeProvider" android:authorities="com.companyname.takikuyumculuk.mono.MonoRuntimeProvider.__mono_init__" android:exported="false" android:initOrder="1999999999" />
<!-- suppress ExportedReceiver -->
<receiver android:name="mono.android.Seppuku">
<intent-filter>
<action android:name="mono.android.intent.action.SEPPUKU" />
<category android:name="mono.android.intent.category.SEPPUKU.com.companyname.takikuyumculuk" />
</intent-filter>
</receiver>
<provider android:name="com.google.firebase.provider.FirebaseInitProvider" android:authorities="com.companyname.takikuyumculuk.firebaseinitprovider" android:exported="false" android:initOrder="100" />
<service android:name="com.google.firebase.components.ComponentDiscoveryService" android:exported="false">
<meta-data android:name="com.google.firebase.components:com.google.firebase.iid.Registrar" android:value="com.google.firebase.components.ComponentRegistrar" />
</service>
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</receiver>
<!--
FirebaseInstanceIdService performs security checks at runtime,
no need for explicit permissions despite exported="true"
-->
<service android:name="com.google.firebase.iid.FirebaseInstanceIdService" android:exported="true">
<intent-filter android:priority="-500">
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<!--
FirebaseMessagingService performs security checks at runtime,
no need for explicit permissions despite exported="true"
-->
<service android:name="com.google.firebase.messaging.FirebaseMessagingService" android:exported="true">
<intent-filter android:priority="-500">
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity" android:exported="false" android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<service android:name="crc64a98abb514ffad9f1.KeepAliveService" />
<receiver android:enabled="true" android:exported="false" android:label="Essentials Battery Broadcast Receiver" android:name="crc64a0e0a82d0db9a07d.BatteryBroadcastReceiver" />
<receiver android:enabled="true" android:exported="false" android:label="Essentials Energy Saver Broadcast Receiver" android:name="crc64a0e0a82d0db9a07d.EnergySaverBroadcastReceiver" />
<receiver android:enabled="true" android:exported="false" android:label="Essentials Connectivity Broadcast Receiver" android:name="crc64a0e0a82d0db9a07d.ConnectivityBroadcastReceiver" />
<provider android:authorities="com.companyname.takikuyumculuk.fileProvider" android:exported="false" android:grantUriPermissions="true" android:name="xamarin.essentials.fileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="#xml/xamarin_essentials_fileprovider_file_paths" />
</provider>
<provider android:name="mono.MonoRuntimeProvider" android:exported="false" android:initOrder="1999999999" android:authorities="com.companyname.takikuyumculuk.mono.MonoRuntimeProvider.__mono_init__" />
<!--suppress ExportedReceiver-->
</application>
</manifest>
This is the error while I building the project.
I solved the problem by removing duplicated lines from AndroidManifest.xml which exists in Android.Properties. After I Rebuild it and problem is solved :)
I have an app I released to a private Google Play Alpha. I can install this exact same APK to my Android Emulator just fine with
adb pm install
but through the Google Play store it is marked for this exact same Emulator as
Your device isn't compatible with this version.
This is the same apk. I can't figure out how to get any information on why the play store thinks it's not compatible.
My manifest looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="2"
android:versionName="1.0"
package="com.company.example"
platformBuildVersionCode="26"
platformBuildVersionName="8.0.0">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="26" />
<uses-permission
android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission
android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.WAKE_LOCK" />
<uses-permission
android:name="com.android.vending.BILLING" />
<meta-data
android:name="android.support.VERSION"
android:value="26.0.0-alpha1" />
<uses-permission
android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="com.company.example.permission.C2D_MESSAGE"
android:protectionLevel="0x2" />
<uses-permission
android:name="com.company.example.permission.C2D_MESSAGE" />
<application
android:theme="#ref/0x7f0b01b8"
android:label="#ref/0x7f090022"
android:icon="#ref/0x7f030000"
android:allowBackup="true"
android:hardwareAccelerated="true"
android:supportsRtl="true">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#ref/0x7f02005b" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="#ref/0x7f0e001d" />
<service
android:name="com.company.example.MyFirebaseMessagingService">
<intent-filter>
<action
android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<receiver
android:name="com.company.example.FCMbroadcast"
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.servpro.activity" />
</intent-filter>
</receiver>
<activity
android:name="com.company.example.SplashScreen">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name="com.google.firebase.messaging.FirebaseMessagingService"
android:exported="true">
<intent-filter
android:priority="-500">
<action
android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="true"
android:exported="false" />
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
android:permission="android.permission.INSTALL_PACKAGES"
android:enabled="true">
<intent-filter>
<action
android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<service
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true"
android:exported="false" />
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
android:permission="com.google.android.c2dm.permission.SEND"
android:exported="true">
<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.example" />
</intent-filter>
</receiver>
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
android:exported="false" />
<service
android:name="com.google.firebase.iid.FirebaseInstanceIdService"
android:exported="true">
<intent-filter
android:priority="-500">
<action
android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<provider
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:exported="false"
android:authorities="com.company.example.firebaseinitprovider"
android:initOrder="100" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#ref/0x7f0d0006" />
</application>
</manifest>
My emulator version is Android 8.0.0 and API is 26.
I find the problem it's used Wifi feature permission emulator was not have wifi so i add following code like wifi is not needed compulsory it's solved my problem.
<uses-feature android:name="android.hardware.wifi" android:required="false" />
<uses-feature android:name="android.hardware.faketouch" android:required="false" />
I implemented GCM push notification with play services 8.4 and sending via php with high priority.
In my Android 4.3 I receive the message, even if after a few minutes while a J5 Samsung with Android 5.1 can take several hours and sometimes is not even received.
I followed the google implementation guidelines for the gcm.
In diagnosing GCM for the J5 of the message tracking token it is indicated as received by GCM but nothing else.
J5 on other applications (whatsapp) receive notifications even in standby but not mine. Now it is as I seek solutions.
I tried through alarm to wake up the manager app to input this, I tried with all the mechanisms suggested by Google but nothing.
I found the information about it of 'HeartBeat but I understood that only decreases the contact time (from 28 minutes to as many as you want in a mobile connection) of the device to the GCM but the situation would not change.
I do not care if the message comes after one hour, but the important thing is to arrive before my death.
Help!
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.customer.myapp"
android:installLocation="auto"
android:versionCode="20"
android:versionName="1.4.4" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="23"/>
<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="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"
/>
<permission android:name="com.customer.myapp.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.customer.myapp.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="23"/>
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"
android:maxSdkVersion="23"/>
<application
android:allowBackup="true"
android:icon="#drawable/main_logo"
android:label="#string/app_name"
android:logo="#drawable/main_logo" >
<activity
android:name=".Main"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- .GcmBroadcastReceiver, Aggiunto exported -->
<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.customer.myapp" />
</intent-filter>
</receiver>
<service
android:name=".MyGCMListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name=".MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<receiver
android:name=".Boot"
android:enabled="true"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".FBActivity"
android:label="#string/title_activity_fb"
android:parentActivityName=".Main" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.customer.myapp.Main" />
</activity>
<activity
android:name="com.facebook.LoginActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/app_id" />
<provider
android:name="com.facebook.NativeAppCallContentProvider"
android:authorities="com.facebook.app.NativeAppCallContentProviderXXXXXXXXX"
android:exported="true" />
<receiver android:name=".FacebookBroadcastReceiver" >
<intent-filter>
<action
android:name="com.facebook.platform.AppCallResultBroadcast" />
</intent-filter>
</receiver>
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<activity
android:name=".WebviewAct"
android:label="#string/title_activity_webview"
android:parentActivityName=".Main" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.customer.myapp.Main" />
</activity>
<activity
android:name=".ArgomentiActivity"
android:label="#string/title_activity_argomenti"
android:parentActivityName=".Main" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.customer.myapp.Main" />
</activity>
<activity
android:name=".Luoghi"
android:label="#string/title_activity_luoghi" >
</activity>
<activity
android:name=".InfoActivity"
android:label="#string/title_activity_info" >
</activity>
<service android:name=".RegistrationIntentService"
android:exported="false"></service>
<receiver android:process=":remote" android:name=".BroadcastFormyapp">
</receiver>
<receiver android:name=".AutoStart">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<service
android:name=".ServiceAlarm"
android:enabled="true"
> <!-- android:process=":" -->
</service>
<service
android:name=".GcmIntentService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
</application>
</manifest>
Payload in PHP:
$fields=array(
"registration_ids"=>$registration_ids,
"delay_while_idle" => true,
"priority" => "high",
"data"=>$message
);
I have two android projects. one of the projects i run the app in the android studio through usb on my smartphone, and one project it saves the APK on the smartphone, while in the second project it does not saves the APK on the smartphone.
what can i do to solve this, because im using google cloud messaging and when the APK is not install in the smartphone it cant get notifications.
for example
in this picture
you can see the application "GCMTest" stored in the smartphone
but in the other project it does not store the APK
how can i solve this?
The Manifest of the project that does not install the APK in smartphone
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.world.bolandian.watchme"
android:installLocation="preferExternal">
<!-- To access Google+ APIs: -->
<uses-permission android:name="android.permission.INTERNET" />
<!--
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 retrieve the account name (email) as part of sign-in: -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- 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" />
<!-- [START gcm_permission] -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission
android:name="com.world.bolandian.watchme.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.world.bolandian.watchme.permission.C2D_MESSAGE" />
<!-- [END gcm_permission] -->
<application
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">
<intent-filter>
<action android:name="com.world.bolandian.watchme.MainActivity" />
<category android:name="android.intent.category.default" />
</intent-filter>
</activity>
<!--
<activity
android:name="."
android:label="#string/title_activity_register" >
<intent-filter>
<action android:name="com.world.bolandian.watchme.Register" />
<category android:name="android.intent.category.default" />
</intent-filter>
</activity>
-->
<activity
android:name=".Login"
android:label="#string/title_activity_login"
android:windowSoftInputMode="adjustResize|stateHidden">
<intent-filter>
<action android:name="com.world.bolandian.watchme.Login" />
<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" />
<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"></action>
<category android:name="com.world.bolandian.watchme" />
</intent-filter>
</receiver>
<service
android:name=".MyGcmListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name=".MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<service
android:name=".RegistrationIntentService"
android:exported="false"></service>
<meta-data
android:name="com.google.android.gms.wallet.api.enabled"
android:value="true"/>
</application>
Manifest of the second project that install the APK in the smartphone
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.world.bolandian.gcmtest">
<!-- To access Google+ APIs: -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<!-- To retrieve the account name (email) as part of sign-in: -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- 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" />
<!-- [START gcm_permission] -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission android:name="com.world.bolandian.gcmtest.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.world.bolandian.gcmtest.permission.C2D_MESSAGE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<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.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.world.bolandian.gcmtest" />
</intent-filter>
</receiver>
<service
android:name=".MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name=".MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<service
android:name=".RegistrationIntentService"
android:exported="false"></service>
</application>
</manifest>