Example #1
0
        public static void Init(string senderId)
        {
            Debug.Log("senderId: " + senderId);
            if (Initted)
            {
                Debug.LogFormat("Android has already been initialized");
                return;
            }

            PlayFabPluginEventHandler.Init();

#if UNITY_ANDROID && !UNITY_EDITOR
            AndroidPlugin = new AndroidJavaClass("com.playfab.unityplugin.PlayFabUnityAndroidPlugin");

            string applicationName = "PlayFab Application";
#if UNITY_5 || UNITY_5_1
            applicationName = Application.productName;
#endif
            var staticParams = new object[] { senderId, applicationName };

            AndroidPlugin.CallStatic("initGCM", staticParams);

            PlayServicesUtils = new AndroidJavaClass("com.playfab.unityplugin.GCM.PlayServicesUtils");
#endif
            PlayFabGoogleCloudMessaging.Init();

            Initted = true;
        }
Example #2
0
        public static void Init(string SenderID)
        {
            if (Initted)
            {
                return;
            }

            PlayFabPluginEventHandler.Init();

#if UNITY_ANDROID && !UNITY_EDITOR
            AndroidPlugin = new AndroidJavaClass("com.playfab.unityplugin.PlayFabUnityAndroidPlugin");

            string applicationName = "PlayFab Application";
#if UNITY_5 || UNITY_5_1
            applicationName = Application.productName;
#endif
            var staticParams = new object[] { SenderID, applicationName };

            AndroidPlugin.CallStatic("initGCM", staticParams);

            PlayServicesUtils = new AndroidJavaClass("com.playfab.unityplugin.GCM.PlayServicesUtils");
#endif
            PlayFabGoogleCloudMessaging.Init();

            Initted = true;
        }
Example #3
0
        public static void init()
        {
            if (Initted)
            {
                return;
            }

            PlayFabPluginEventHandler.init();

#if PLAYFAB_ANDROID_PLUGIN
            AndroidPlugin = new AndroidJavaClass("com.playfab.unity.plugin.AndroidPlugin");
            AndroidPlugin.CallStatic("init");

            PlayServicesUtils = new AndroidJavaClass("com.playfab.unity.plugin.PlayServicesUtils");
#endif
            PlayFabGoogleCloudMessaging.init();

            Initted = true;
        }