sync
This commit is contained in:
@@ -15,7 +15,7 @@ MonoBehaviour:
|
|||||||
m_DefaultGroup: af10c9716f97a20469b8fc257eec4a13
|
m_DefaultGroup: af10c9716f97a20469b8fc257eec4a13
|
||||||
m_currentHash:
|
m_currentHash:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
Hash: ea94b3f7985f7214a5719239922767ff
|
Hash: 00000000000000000000000000000000
|
||||||
m_OptimizeCatalogSize: 0
|
m_OptimizeCatalogSize: 0
|
||||||
m_BuildRemoteCatalog: 1
|
m_BuildRemoteCatalog: 1
|
||||||
m_CatalogRequestsTimeout: 0
|
m_CatalogRequestsTimeout: 0
|
||||||
|
|||||||
@@ -7,13 +7,14 @@
|
|||||||
<!-- The MessagingUnityPlayerActivity is a class that extends
|
<!-- The MessagingUnityPlayerActivity is a class that extends
|
||||||
UnityPlayerActivity to work around a known issue when receiving
|
UnityPlayerActivity to work around a known issue when receiving
|
||||||
notification data payloads in the background. -->
|
notification data payloads in the background. -->
|
||||||
<activity android:name="com.google.firebase.MessagingUnityPlayerActivity" android:theme="@style/UnityThemeSelector" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
|
<activity android:name="com.google.firebase.MessagingUnityPlayerActivity" android:theme="@style/BaseUnityGameActivityTheme" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
|
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
|
||||||
</activity>
|
</activity>
|
||||||
<service android:name="com.google.firebase.messaging.MessageForwardingService" android:permission="android.permission.BIND_JOB_SERVICE" android:exported="true"></service>
|
<service android:name="com.google.firebase.messaging.MessageForwardingService" android:permission="android.permission.BIND_JOB_SERVICE" android:exported="true">
|
||||||
|
</service>
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* This file is generated by the FirebaseMessagingActivityGenerator script.
|
||||||
|
* Refer to that script for more information.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.google.firebase;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import com.google.firebase.messaging.MessageForwardingService;
|
||||||
|
import com.unity3d.player.UnityPlayerGameActivity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MessagingUnityPlayerActivity is a UnityPlayerGameActivity that updates its intent when new intents
|
||||||
|
* are sent to it.
|
||||||
|
*
|
||||||
|
* This is a workaround for a known issue that prevents Firebase Cloud Messaging from responding to
|
||||||
|
* data payloads when both a data and notification payload are sent to the app while it is in the
|
||||||
|
* background.
|
||||||
|
*/
|
||||||
|
public class MessagingUnityPlayerActivity extends UnityPlayerGameActivity {
|
||||||
|
// The key in the intent's extras that maps to the incoming message's message ID. Only sent by
|
||||||
|
// the server, GmsCore sends EXTRA_MESSAGE_ID_KEY below. Server can't send that as it would get
|
||||||
|
// stripped by the client.
|
||||||
|
private static final String EXTRA_MESSAGE_ID_KEY_SERVER = "message_id";
|
||||||
|
|
||||||
|
// An alternate key value in the intent's extras that also maps to the incoming message's message
|
||||||
|
// ID. Used by upstream, and set by GmsCore.
|
||||||
|
private static final String EXTRA_MESSAGE_ID_KEY = "google.message_id";
|
||||||
|
|
||||||
|
// The key in the intent's extras that maps to the incoming message's sender value.
|
||||||
|
private static final String EXTRA_FROM = "google.message_id";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Workaround for when a message is sent containing both a Data and Notification payload.
|
||||||
|
*
|
||||||
|
* <p>When the app is in the background, if a message with both a data and notification payload is
|
||||||
|
* received the data payload is stored on the Intent passed to onNewIntent. By default, that
|
||||||
|
* intent does not get set as the Intent that started the app, so when the app comes back online
|
||||||
|
* it doesn't see a new FCM message to respond to. As a workaround, we override onNewIntent so
|
||||||
|
* that it sends the intent to the MessageForwardingService which forwards the message to the
|
||||||
|
* FirebaseMessagingService which in turn sends the message to the application.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void onNewIntent(Intent intent) {
|
||||||
|
super.onNewIntent(intent);
|
||||||
|
|
||||||
|
// If we do not have a 'from' field this intent was not a message and should not be handled. It
|
||||||
|
// probably means this intent was fired by tapping on the app icon.
|
||||||
|
Bundle extras = intent.getExtras();
|
||||||
|
if (extras == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String from = extras.getString(EXTRA_FROM);
|
||||||
|
String messageId = extras.getString(EXTRA_MESSAGE_ID_KEY);
|
||||||
|
if (messageId == null) {
|
||||||
|
messageId = extras.getString(EXTRA_MESSAGE_ID_KEY_SERVER);
|
||||||
|
}
|
||||||
|
if (from != null && messageId != null) {
|
||||||
|
Intent message = new Intent(this, MessageForwardingService.class);
|
||||||
|
message.setAction(MessageForwardingService.ACTION_REMOTE_INTENT);
|
||||||
|
message.putExtras(intent);
|
||||||
|
message.setData(intent.getData());
|
||||||
|
MessageForwardingService.enqueueWork(this, message);
|
||||||
|
}
|
||||||
|
setIntent(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispose of the mUnityPlayer when restarting the app.
|
||||||
|
*
|
||||||
|
* <p>This ensures that when the app starts up again it does not start with stale data.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
if (mUnityPlayer != null) {
|
||||||
|
mUnityPlayer.destroy();
|
||||||
|
mUnityPlayer = null;
|
||||||
|
}
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1f13996192a0abc8cadaa39c71346066
|
||||||
|
labels:
|
||||||
|
- FirebaseMessagingActivityGenerated
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 3
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
Android:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
Any:
|
||||||
|
enabled: 0
|
||||||
|
settings: {}
|
||||||
|
Editor:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -141,7 +141,7 @@ PlayerSettings:
|
|||||||
loadStoreDebugModeEnabled: 0
|
loadStoreDebugModeEnabled: 0
|
||||||
visionOSBundleVersion: 1.0
|
visionOSBundleVersion: 1.0
|
||||||
tvOSBundleVersion: 1.0
|
tvOSBundleVersion: 1.0
|
||||||
bundleVersion: 1.46
|
bundleVersion: 1.47
|
||||||
preloadedAssets:
|
preloadedAssets:
|
||||||
- {fileID: -944628639613478452, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3}
|
- {fileID: -944628639613478452, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3}
|
||||||
metroInputSource: 0
|
metroInputSource: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user