public static void CancelNotifications(string message)
 {
     Debug.Log("CANCEL NOTIFICATIONS: " + message);
             #if !UNITY_EDITOR && UNITY_IPHONE
     NativeMessageBinding.Native_CancelNotifications(message);
             #elif !UNITY_EDITOR && UNITY_ANDROID
     //TODO TALIN - Notification are currently overriden in Android, we should implement a cancel function
             #endif
 }
 public static void ScheduleNotification(string title, string message, long showTime)
 {
     Debug.Log("SCHEDULE NOTIFICATION: " + title + "  |  " + message + "  |  " + showTime);
             #if !UNITY_EDITOR && UNITY_IPHONE
     NativeMessageBinding.Native_ScheduleNotification(title, message, showTime);
             #elif !UNITY_EDITOR && UNITY_ANDROID
     NativeMessageBinding.javaBinding.CallStatic("ScheduleNotification", title, message, showTime);
             #endif
 }
 //wenming modify  string button2="", string button3=""
 public void ShowMessage(string title, string message, string button1, string button2 = "", string button3 = "")
 {
             #if !UNITY_EDITOR && UNITY_IPHONE
     NativeMessageBinding.Native_ShowMessage(title, message, button1, button2, button3);
             #elif !UNITY_EDITOR && UNITY_ANDROID
     NativeMessageBinding.javaBinding.CallStatic("ShowMessage", title, message, button1, button2, button3);
             #else
     ButtonPressed("0");
             #endif
 }
Beispiel #4
0
    void OnRateButtonPressed(int index)
    {
        NativeMessagesSystem.OnButtonPressed -= OnRateButtonPressed;

        Debug.Log("RATE APP: " + index);

        //TODO - take action based on button index
        if (index == neverIdx)
        {
            PlayerPrefs.SetInt(neverRateKey, 1);
        }
        else if (index == rateIdx)
        {
            PlayerPrefs.SetInt(ratedKey, 1);
#if !UNITY_EDITOR && UNITY_IPHONE
            Application.OpenURL(NativeMessageBinding.Native_GetRateLink(appId));
#elif UNITY_ANDROID
            Application.OpenURL("market://details?id=" + appId);
#endif
        }
    }