Open sahilpma opened 1 year ago
In the github docs, you need to remove the Firebase sections. It overrides Flurry's settings.
You can safely replace AndroidManifest.xml generated by Firebase with Flurry's.
I.e., replace/remove the following 2 sections.
com.unity3d.player.UnityPlayerActivity
instead of com.google.firebase.MessagingUnityPlayerActivity
.
<!-- Unity Main Activity -->
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<service android:name="com.google.firebase.messaging.MessageForwardingService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="false" >
</service>
<service android:name="com.flurry.android.marketing.messaging.FCM.FlurryInstanceIDListenerService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
@sahilpma Have you resolved your issues? Besides the above solutions, please also try the latest version 6.2.0 which fixed several notification migrations (Android 12/13 changed many notification requirements). Thanks!
@sahilpma Besides, though the Android developer docs say "recommended" to add POST_NOTIFICATIONS
permission for Android 13 and above devices. As I found, it is actually "required" to add this permission! Please do add the following post notification permission to the manifest file:
uses-permission android:name=”android.permission.POST_NOTIFICATIONS”
And in your app, do use ActivityCompat.requestPermissions
to request the permission if ContextCompat.checkSelfPermission
returns PackageManager.PERMISSION_DENIED
.
Examples codes,
private static List<String> PERMISSIONS;
static {
PERMISSIONS = new ArrayList<>();
PERMISSIONS.add(Manifest.permission.ACCESS_FINE_LOCATION);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
PERMISSIONS.add(Manifest.permission.POST_NOTIFICATIONS);
}
}
...
for (String permission : PERMISSIONS) {
if (ContextCompat.checkSelfPermission(this, permission) == PackageManager.PERMISSION_DENIED) {
// Simply request permissions if one of them is missing
ActivityCompat.requestPermissions(this, PERMISSIONS.toArray(new String[0]), PERMISSION_REQUEST);
break;
}
}
I am using Unity 2022.1.14f1 with flurry 6.0.0 version. I have followed the steps as per github docs. I am receiving FCM message, but notification is not shown.
Here is my manifest file
`<?xml version="1.0" encoding="utf-8"?>