예제 #1
0
     public static void TestInAppMessaging(string inAppMessage)
     {
 #if UNITY_ANDROID && !UNITY_EDITOR
         PusheInAppMessaging.TestInAppMessage(inAppMessage);
 #elif UNITY_IOS && !UNITY_EDITOR
         // not implemented
 #endif
     }
예제 #2
0
     public static void SetInAppMessagingListener(IPusheInAppMessagingListener listener)
     {
 #if UNITY_ANDROID && !UNITY_EDITOR
         PusheInAppMessaging.SetInAppMessagingListener(listener);
 #elif UNITY_IOS && !UNITY_EDITOR
         // not implemented
 #endif
     }
예제 #3
0
     public static void DisableInAppMessaging()
     {
 #if UNITY_ANDROID && !UNITY_EDITOR
         PusheInAppMessaging.DisableInAppMessaging();
 #elif UNITY_IOS && !UNITY_EDITOR
         // not implemented
 #endif
     }
예제 #4
0
     public static void TriggerEvent(string eventName)
     {
 #if UNITY_ANDROID && !UNITY_EDITOR
         PusheInAppMessaging.TriggerEvent(eventName);
 #elif UNITY_IOS && !UNITY_EDITOR
         // not implemented
 #endif
     }
예제 #5
0
     public static bool IsInAppMessagingEnabled()
     {
 #if UNITY_ANDROID && !UNITY_EDITOR
         return(PusheInAppMessaging.IsInAppMessagingEnabled());
 #elif UNITY_IOS && !UNITY_EDITOR
         // not implemented
         return(false);
 #endif
         return(false);
     }
예제 #6
0
    /**
     * Called when Pushe is registered.
     */
    private void OnPusheRegisteredSuccessfully()
    {
        PusheUnity.Log(" --- Pushe has been REGISTERED to server successfully --- ");
        var adId = PusheUnity.GetAdvertisingId();

        PusheUnity.Log("Ad id: " + adId);
        var deviceId = PusheUnity.GetDeviceId();

        PusheUnity.Log("Device id : " + deviceId);

        // Pushe Notification

        PusheUnity.Log("Notification enabled? " + PusheNotification.IsNotificationEnabled());
        PusheUnity.Log("Custom sound enabled? " + PusheNotification.IsCustomSoundEnabled());
        PusheNotification.CreateNotificationChannel("CustomChannel", "CustomChannel");

        // Analytics
        PusheAnalytics.SendEvent("Some_Event");
        PusheAnalytics.SendEcommerceData("EcommerceData", 12.0);

        PusheUnity.Log("Subscribing to test1");
        PusheUnity.Subscribe("test1");

        PusheUnity.Log("Set 123123 as custom id");
        PusheUnity.SetCustomId("123123");
        PusheUnity.Log("CustomId is: " + PusheUnity.GetCustomId());

        var tags = new Dictionary <string, string> {
            { "name", "Mohammad" }, { "age", "25" }, { "birthday", "1435187386" }
        };

        PusheUnity.AddTags(tags);

        PusheUnity.RemoveTags("name", "age");

        PusheUnity.Log("Tags: " + PusheUnity.GetSubscribedTags());
        PusheUnity.Log("Topics: " + string.Join(",", PusheUnity.GetSubscribedTopics()));

        PusheInAppMessaging.DisableInAppMessaging();
        PusheUnity.Log("Is in app messaging enabled?" + PusheInAppMessaging.IsInAppMessagingEnabled());
        PusheInAppMessaging.EnableInAppMessaging();
        PusheUnity.Log("Is in app messaging enabled? " + PusheInAppMessaging.IsInAppMessagingEnabled());
        PusheInAppMessaging.TriggerEvent("qqq");
        PusheInAppMessaging.SetInAppMessagingListener(new InAppMessagingListener());
    }
예제 #7
0
    /**
     * Called when Pushe is registered.
     */
    private void OnPusheRegisteredSuccessfully()
    {
        PusheUnity.Log(" --- Pushe has been REGISTERED to server successfully --- ");
        var adId = PusheUnity.GetAdvertisingId();

        PusheUnity.Log("Ad id: " + adId);
        var deviceId = PusheUnity.GetDeviceId();

        PusheUnity.Log("Device id : " + deviceId);

        // Pushe Notification

        PusheUnity.Log("Notification enabled? " + PusheNotification.IsNotificationEnabled());
        PusheUnity.Log("Custom sound enabled? " + PusheNotification.IsCustomSoundEnabled());
        // PusheNotification.CreateNotificationChannel("CustomChannel", "CustomChannel");
        PusheUnity.Log("Sending d2d");
        PusheNotification.SendNotificationToUser(UserNotification.WithDeviceId(PusheUnity.GetDeviceId()).SetTitle("Title").SetContent("Content"));
        // Analytics
        PusheAnalytics.SendEvent("Some_Event");
        PusheAnalytics.SendEcommerceData("EcommerceData", 12.0);

        PusheUnity.Log("Subscribing to test1");
        PusheUnity.Subscribe("test1");

        PusheUnity.Log("Set 123123 as custom id");
        PusheUnity.SetCustomId("123123");
        PusheUnity.Log("CustomId is: " + PusheUnity.GetCustomId());

        var tags = new Dictionary <string, string> {
            { "name", "Mohammad" }, { "age", "25" }, { "birthday", "1435187386" }
        };

        PusheUnity.AddTags(tags);

        PusheUnity.RemoveTags("name", "age");

        PusheUnity.Log("Tags: " + PusheUnity.GetSubscribedTags());
        PusheUnity.Log("Topics: " + string.Join(",", PusheUnity.GetSubscribedTopics()));

        // InAppMessaging
        PusheInAppMessaging.DisableInAppMessaging();
        PusheUnity.Log("Is in app messaging enabled?" + PusheInAppMessaging.IsInAppMessagingEnabled());
        PusheInAppMessaging.EnableInAppMessaging();
        PusheUnity.Log("Is in app messaging enabled? " + PusheInAppMessaging.IsInAppMessagingEnabled());
        PusheInAppMessaging.TriggerEvent("qqq");
        PusheInAppMessaging.SetInAppMessagingListener(new InAppMessagingListener());

        // FCM token and ...
        var fcmToken      = PusheUnity.GetFcmToken();
        var hmsToken      = PusheUnity.GetHmsToken();
        var activeService = PusheUnity.GetActiveService();

        PusheUnity.Log("Fcm token: " + fcmToken + "\nHms token: " + hmsToken + "\nActive service: " + activeService);

        // Foreground awareness feature of notification
        PusheUnity.Log("Are all notifications aware of foreground state? " + PusheUnity.IsForceForegroundAware());
        PusheUnity.Log("Toggle to true");
        PusheUnity.EnableNotificationForceForegroundAware();
        PusheUnity.Log("Are all notifications aware of foreground state? " + PusheUnity.IsForceForegroundAware());
        PusheUnity.Log("Toggle back to false");
        PusheUnity.DisableNotificationForceForegroundAware();
        PusheUnity.Log("Are all notifications aware of foreground state? " + PusheUnity.IsForceForegroundAware());
    }