Exemplo n.º 1
0
    // **************************
    // Public functions
    // **************************

    public void Start()
    {
        // Enable line below to enable logging if you are having issues setting up OneSignal. (logLevel, visualLogLevel)
        // OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.INFO, OneSignal.LOG_LEVEL.INFO);

        OneSignal.StartInit("764072f7-5054-4058-b5a6-f5bb724fead1")
        .HandleNotificationOpened(HandleNotificationOpened)
        .HandleNotificationReceived(HandleNotificationReceived)
        .InFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
        .EndInit();

        OneSignal.IdsAvailable((userId, pushToken) =>
        {
            m_oneSignalPlayerID  = userId;
            m_oneSignalPushToken = pushToken;

            if (Debug.isDebugBuild)
            {
                Debug.Log("------- VREEL: UserID: " + userId + " - PushToken: " + pushToken);
            }
        });

        // Call syncHashedEmail anywhere in your app if you have the user's email.
        // This improves the effectiveness of OneSignal's "best-time" notification scheduling feature.
        // OneSignal.syncHashedEmail(userEmail);

        if (Debug.isDebugBuild)
        {
            OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.DEBUG, OneSignal.LOG_LEVEL.DEBUG);
        }
    }
Exemplo n.º 2
0
    void Start()
    {
        extraMessage = null;

        // Enable line below to debug issues with setuping OneSignal. (logLevel, visualLogLevel)
        OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);

        // If you set to true, the user will have to provide consent
        // using OneSignal.UserDidProvideConsent(true) before the
        // SDK will initialize
        OneSignal.SetRequiresUserPrivacyConsent(requiresUserPrivacyConsent);

        // The only required method you need to call to setup OneSignal to receive push notifications.
        // Call before using any other methods on OneSignal (except setLogLevel or SetRequiredUserPrivacyConsent)
        // Should only be called once when your app is loaded.
        // OneSignal.Init(OneSignal_AppId);
        OneSignal.StartInit("241adf49-a128-4b4b-830a-5edd482602b3")
        .HandleNotificationReceived(HandleNotificationReceived)
        .HandleNotificationOpened(HandleNotificationOpened)
        .HandleInAppMessageClicked(HandlerInAppMessageClicked)
        .EndInit();

        OneSignal.inFocusDisplayType         = OneSignal.OSInFocusDisplayOption.Notification;
        OneSignal.permissionObserver        += OneSignal_permissionObserver;
        OneSignal.subscriptionObserver      += OneSignal_subscriptionObserver;
        OneSignal.emailSubscriptionObserver += OneSignal_emailSubscriptionObserver;

        var pushState = OneSignal.GetPermissionSubscriptionState();

        OneSignalInAppMessageTriggerExamples();
    }
Exemplo n.º 3
0
    void Start()
    {
        extraMessage = null;

        // Enable line below to debug issues with setuping OneSignal. (logLevel, visualLogLevel)
        OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);

        // The only required method you need to call to setup OneSignal to receive push notifications.
        // Call before using any other methods on OneSignal.
        // Should only be called once when your app is loaded.
        // OneSignal.Init(OneSignal_AppId);
        OneSignal.StartInit("b2f7f966-d8cc-11e4-bed1-df8f05be55ba")
        .HandleNotificationReceived(HandleNotificationReceived)
        .HandleNotificationOpened(HandleNotificationOpened)
        //.InFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
        .EndInit();

        OneSignal.inFocusDisplayType    = OneSignal.OSInFocusDisplayOption.Notification;
        OneSignal.permissionObserver   += OneSignal_permissionObserver;
        OneSignal.subscriptionObserver += OneSignal_subscriptionObserver;

        var pushState = OneSignal.GetPermissionSubscriptionState();

        Debug.Log("pushState.subscriptionStatus.subscribed : " + pushState.subscriptionStatus.subscribed);
        Debug.Log("pushState.subscriptionStatus.userId : " + pushState.subscriptionStatus.userId);
    }
Exemplo n.º 4
0
    void Start()
    {
        if (PlayerPrefs.GetInt("PrimeraVez") == 0)
        {
            extraMessage = null;

            // Enable line below to debug issues with setuping OneSignal. (logLevel, visualLogLevel)
            OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);

            // The only required method you need to call to setup OneSignal to receive push notifications.
            // Call before using any other methods on OneSignal.
            // Should only be called once when your app is loaded.
            // OneSignal.Init(OneSignal_AppId, GoogleProjectNumber);
            OneSignal.StartInit("ecb87d2e-1d24-401d-ae69-ae6aeedfe69f", "991857066362")
            .HandleNotificationReceived(HandleNotificationReceived)
            .HandleNotificationOpened(HandleNotificationOpened)
            .InFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
            .EndInit();

            PlayerPrefs.SetInt("PrimeraVez", 1);
            PlayerPrefs.SetInt("Subs", 1);
            BtnYes.SetActive(true);
        }

        if (PlayerPrefs.GetInt("Subs") == 0)
        {
            BtnYes.SetActive(false);
            BtnNo.SetActive(true);
        }
        if (PlayerPrefs.GetInt("Subs") == 1)
        {
            BtnYes.SetActive(true);
            BtnNo.SetActive(false);
        }
    }
Exemplo n.º 5
0
    void Start()
    {
        AppsFlyer.setAppsFlyerKey("yHiUWGDALquAxRVr3LCn8V");
        #if UNITY_IOS
        AppsFlyer.setAppID("yHiUWGDALquAxRVr3LCn8V");
        AppsFlyer.trackAppLaunch();
        #elif UNITY_ANDROID
        AppsFlyer.setAppID("com.qwe.qwe-Standalone");
        AppsFlyer.init("yHiUWGDALquAxRVr3LCn8V", "AppsFlyerTrackerCallbacks");
        #endif

        StartCoroutine(appFlyerCor());


        OneSignal.StartInit("f512932f-26c4-4060-82bc-ee1a54a2d5d7")
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.DEBUG, OneSignal.LOG_LEVEL.DEBUG);

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;


        var webViewGameObject = new GameObject("UniWebView");
        webView = webViewGameObject.AddComponent <UniWebView>();

        webView.toolBarShow = true;
        webView.Load("https://google.com");
        webView.Show();
    }
        public void Init()
        {
            bool autoPrompt = false, inAppLaunchURL = false;

            if (_builder.IOSSettings != null)
            {
                if (_builder.IOSSettings.ContainsKey(kOSSettingsKeyAutoPrompt))
                {
                    autoPrompt = _builder.IOSSettings[kOSSettingsKeyAutoPrompt];
                }
                if (_builder.IOSSettings.ContainsKey(kOSSettingsKeyInAppLaunchURL))
                {
                    inAppLaunchURL = _builder.IOSSettings[kOSSettingsKeyInAppLaunchURL];
                }
            }

            var convertedLogLevel    = (OneSLogLevel)((ulong)((int)_logLevel));
            var convertedVisualLevel = (OneSLogLevel)((ulong)((int)_visualLogLevel));

            OneSignal.SetLogLevel(convertedLogLevel, convertedVisualLevel);

            var dict = new Foundation.NSDictionary("kOSSettingsKeyInAppLaunchURL"
                                                   , new Foundation.NSNumber(inAppLaunchURL)
                                                   , "kOSSettingsKeyAutoPrompt"
                                                   , new Foundation.NSNumber(autoPrompt)
                                                   , "kOSSettingsKeyInFocusDisplayOption"
                                                   , new Foundation.NSNumber((int)_builder.DisplayOption));

            OneSignal.InitWithLaunchOptions(new Foundation.NSDictionary()
                                            , _builder.AppID
                                            , NotificationReceivedHandler
                                            , NotificationOpenedHandler
                                            , dict);
        }
        public void SetLogLevel(LogLevelEnum logLevel, LogLevelEnum visualLevel)
        {
            var convertedLogLevel    = (OneSLogLevel)((ulong)((int)logLevel));
            var convertedVisualLevel = (OneSLogLevel)((ulong)((int)visualLevel));

            OneSignal.SetLogLevel(convertedLogLevel, convertedVisualLevel);
        }
Exemplo n.º 8
0
 void Start()
 {
     OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.NONE, OneSignal.LOG_LEVEL.NONE);
     OneSignal.StartInit("ca066e57-a54e-4704-9020-7aecdcd219f0")
     .HandleNotificationOpened(HandleNotificationOpened)
     .EndInit();
     OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
     DontDestroyOnLoad(gameObject);
 }
Exemplo n.º 9
0
    // Use this for initialization
    void Start()
    {
        OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);

        OneSignal.StartInit("---")
        .HandleNotificationReceived(HandleNotificationReceived)
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();
    }
Exemplo n.º 10
0
    void Start()
    {
        OneSignal.StartInit(id)
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;

        OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.DEBUG, OneSignal.LOG_LEVEL.DEBUG);
    }
Exemplo n.º 11
0
    void Start()
    {
        Debug.Log("InitOneSignal mono behaviour Start() -->");

        OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);

        OneSignal.StartInit(OS_APP_ID)
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.SetLocationShared(false);

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
        Debug.Log("<-- InitOneSignal mono behaviour Start() done.");
    }
Exemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
                #if !UNITY_EDITOR
        OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);
        OneSignal.StartInit("d1637280-1caa-4fbe-a688-a10c9bb36890")
        .HandleNotificationReceived(HandleNotificationReceived)
        .HandleNotificationOpened(HandleNotificationOpened)
        .InFocusDisplaying(OneSignal.OSInFocusDisplayOption.None)
        .EndInit();

        OneSignal.IdsAvailable((userId, pushToken) => {
            id = userId;
            //StartCoroutine (onCoroutine());
        });
                #endif
    }
Exemplo n.º 13
0
    void Start()
    {
        extraMessage = null;

        // Enable line below to debug issues with setuping OneSignal. (logLevel, visualLogLevel)
        OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);

        // The only required method you need to call to setup OneSignal to receive push notifications.
        // Call before using any other methods on OneSignal.
        // Should only be called once when your app is loaded.
        // OneSignal.Init(OneSignal_AppId);
        OneSignal.StartInit("b2f7f966-d8cc-11e4-bed1-df8f05be55ba")
        .HandleNotificationReceived(HandleNotificationReceived)
        .HandleNotificationOpened(HandleNotificationOpened)
        .InFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
        .EndInit();
    }
Exemplo n.º 14
0
    void Start()
    {
        firstimer.SetActive(false);
        if (PlayerPrefs.GetString("lewat") == "tidak")
        {
            firstimer.SetActive(true);
            PlayerPrefs.SetString("lewat", "Lain");
        }
        loading.SetActive(true);

                #if !UNITY_EDITOR
        OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);
        OneSignal.StartInit("30b6cca5-db55-40a5-8541-0187696d22a7")
        .HandleNotificationReceived(HandleNotificationReceived)
        .HandleNotificationOpened(HandleNotificationOpened)
        .InFocusDisplaying(OneSignal.OSInFocusDisplayOption.None)
        .EndInit();
                #endif

                #if UNITY_EDITOR
        id = "123456789";
                #endif


        long milisecond = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;

        //room_invite = PlayerPrefs.GetString (Link.EMAIL) + "@" + milisecond.ToString ();


        Debug.Log(milisecond);


        StartCoroutine(onCoroutineCekInviting());

        OneSignal.IdsAvailable((userId, pushToken) => {
            id = userId;
            StartCoroutine(onCoroutine());
            StartCoroutine(onCoroutineCekInviting());
        });
    }
Exemplo n.º 15
0
        // world type is based on the type of world the user posseses (3 kinds) // roomID is to join the same photon room based on player id


        void Awake()
        {
            int inPublic = PlayerPrefs.GetInt("isInPublicWorld", -1);

            if (inPublic == -1)
            {
                PlayerPrefs.SetInt("isInPublicWorld", 0);
                inPublic = 0;
            }
            if (inPublic == 1)
            {
                PlayerPrefs.SetInt("isInPublicWorld", 0);
            }
            OneSignal.StartInit("73edd87b-7555-4075-b728-5a27c4fb1a9f")
            .HandleNotificationOpened(HandleNotificationOpened)
            .Settings(new Dictionary <string, bool>()
            {
                { OneSignal.kOSSettingsAutoPrompt, false },
                { OneSignal.kOSSettingsInAppLaunchURL, false }
            })
            .EndInit();
            OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
            OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.INFO, OneSignal.LOG_LEVEL.INFO);
        }