コード例 #1
0
 /**
  * Set CallBack GameObject on which get callback from native
  */
 private static void setNativeCallbackListener()
 {
     if (mInstance == null)
     {
         GameObject receiverObject = new GameObject("App42Push");
         DontDestroyOnLoad(receiverObject);
         mInstance = receiverObject.AddComponent <App42Push> ();
         setListenerGameObject(receiverObject.name);
     }
 }
コード例 #2
0
    public void onDeviceToken(String deviceToken)
    {
        message = "Device token from native: " + deviceToken;
        String deviceType = App42Push.getDeviceType();

        if (deviceType != null && deviceToken != null && deviceToken.Length != 0)
        {
            App42API.BuildPushNotificationService().StoreDeviceToken(App42API.GetLoggedInUser(), deviceToken,
                                                                     deviceType, new Callback());
        }
    }
コード例 #3
0
 public void Start()
 {
     DontDestroyOnLoad(transform.gameObject);
     App42API.Initialize(ApiKey, SecretKey);
     App42API.SetLoggedInUser(UserId);
     //Put Your Game Object Here
     App42Push.setApp42PushListener(this);
             #if UNITY_ANDROID
     App42Push.registerForPush(GoogleProjectNo);
     message = App42Push.getLastPushMessage();
             #endif
 }