Ejemplo n.º 1
0
    private void Start()
    {
        OneSignal.StartInit(appId)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
    }
Ejemplo 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();
    }
Ejemplo 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);
    }
Ejemplo 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);
        }
    }
Ejemplo n.º 5
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);
        }
    }
Ejemplo n.º 6
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();
    }
Ejemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        OneSignal.StartInit("3aa3511a-f03a-4cb8-8734-ff200ab027d5")
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
    }
Ejemplo n.º 8
0
    // Use this for initialization
    void Start()
    {
        OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);

        OneSignal.StartInit("---")
        .HandleNotificationReceived(HandleNotificationReceived)
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();
    }
Ejemplo n.º 9
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);
 }
    //--------------------------------------
    // PUBLIC METHODS
    //--------------------------------------

    public void InitOneSignalNotifications()
    {
                #if ONE_SIGNAL_ENABLED
        OneSignal.StartInit(AndroidNativeSettings.Instance.OneSignalAppID, AndroidNativeSettings.Instance.GCM_SenderId)
        .HandleNotificationReceived(HandleNotificationReceived)
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();
                #endif
    }
Ejemplo n.º 11
0
    void Start()
    {
        OneSignal.StartInit(id)
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;

        OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.DEBUG, OneSignal.LOG_LEVEL.DEBUG);
    }
Ejemplo n.º 12
0
    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("18acf8c9-f31d-485a-92ab-8d7b886be084")
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
    }
    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("3cbbf30e-5e96-4c6d-a428-3f12c701cd4f")
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
    }
Ejemplo n.º 14
0
    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("e2fd4c6c-3911-4b0a-a823-4177a1a87436")
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
    }
Ejemplo n.º 15
0
    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("d941062c-71c4-47a6-ab87-e4fe5a73a755")
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
    }
Ejemplo n.º 16
0
        private void InitialiseOneSignalService()
        {
            OneSignalServiceSettings _settings = NPSettings.AddonServicesSettings.OneSignalService;

            OneSignal.StartInit(appID: _settings.AppID, googleProjectNumber: _settings.GoogleProjectNumber)
            .HandleNotificationReceived(DidReceiveOneSignalNotification)
            .InFocusDisplaying(OneSignal.OSInFocusDisplayOption.None)
            .Settings(new Dictionary <string, bool>()
            {
                { OneSignal.kOSSettingsAutoPrompt, false }
            })
            .EndInit();
        }
Ejemplo n.º 17
0
 /// <summary>
 /// Initializes the push notification service.
 /// </summary>
 public static void Init()
 {
     #if EM_ONESIGNAL
     // The only required method you need to call to setup OneSignal to recieve push notifications.
     // Call before using any other methods on OneSignal.
     // Should only be called once when your game is loaded.
     OneSignal.StartInit(EM_Settings.Notifications.OneSignalAppId)
     .HandleNotificationOpened(HandleNotificationOpened)
     .InFocusDisplaying(OneSignal.OSInFocusDisplayOption.None)
     .EndInit();
     #else
     Debug.LogError("SDK missing. Please import OneSignal plugin for Unity.");
     #endif
 }
Ejemplo n.º 18
0
    protected virtual 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(appKey)
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
        if (sendPushOnStart)
        {
            SendNotification();
        }
    }
Ejemplo n.º 19
0
    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);
        // 6ddb852c-dfca-4e69-84d9-3c5d38a4b34b
        //AndroidRoman//OneSignal.StartInit("18acf8c9-f31d-485a-92ab-8d7b886be084")
        OneSignal.StartInit("6ddb852c-dfca-4e69-84d9-3c5d38a4b34b")// YK
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;

        // проверка
        OneSignal.subscriptionObserver += OneSignal_subscriptionObserver;
    }
Ejemplo n.º 20
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.");
    }
Ejemplo n.º 21
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);

            Xamarin.FormsMaps.Init(this, bundle);

            CrossGeofence.Initialize <CrossGeofenceListener>();

            LoadApplication(new App());

            // Initialize OneSignal
            OneSignal.StartInit("443e79c9-a079-44c0-8b0c-0ae41fa21db9", "914546316019").EndInit();
        }
Ejemplo n.º 22
0
    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("a679caa4-ff0e-4bc9-a39b-57fa977e8e1a")
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.None;

        // 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);
    }
Ejemplo n.º 23
0
    void Start()
    {
        // OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.INFO, OneSignal.LOG_LEVEL.INFO);

        OneSignal.StartInit("ee918653-6c7b-42d3-a7a2-6dbf7458a219")
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;

        Scene currentScene = SceneManager.GetActiveScene();

        sceneName = currentScene.name;

        sceneFader = FindObjectOfType <SceneFader>();
    }
Ejemplo n.º 24
0
    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("503506cc-010c-4ad7-a999-3c2745ac9f37")
        .HandleNotificationReceived(HandleNotificationReceived)
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
        if (PlayerPrefs.GetString("uuid") != null)
        {
            OneSignal.SendTag("uuid", PlayerPrefs.GetString("uuid"));
        }
    }
Ejemplo n.º 25
0
    void Start()
    {
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();

        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.Activate();

        // 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("fa202439-9521-4aa6-ae50-49cd7aee3a2f")
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
    }
Ejemplo n.º 26
0
 /// <summary>
 /// Init the push notification service after an optional delay time.
 /// </summary>
 public static void Init()
 {
     #if EM_ONESIGNAL
     // The only required method you need to call to setup OneSignal to recieve push notifications.
     // Call before using any other methods on OneSignal.
     // Should only be called once when your game is loaded.
     OneSignal.StartInit(EM_Settings.Notification.OneSignalAppId, EM_Settings.Notification.GoogleProjectNumber)
     .HandleNotificationOpened(HandleNotificationOpened)
     .EndInit();
     #else
     if (Debug.isDebugBuild)
     {
         Debug.LogError("SDK missing. Please import OneSignal plugin for Unity.");
     }
     #endif
 }
 void trySubscribeUsersForPushes()
 {
             #if UNITY_IOS
     if (gameLogicController._score >= 20)
     {
         if (gameGlobalSettings.paidGame)
         {
             OneSignal.StartInit(gameGlobalSettings.hdOneSignalId, gameGlobalSettings.hdOneSignalProjectNumber).EndInit();
         }
         else
         {
             OneSignal.StartInit(gameGlobalSettings.freeOneSignalId, gameGlobalSettings.freeOneSignalProjectNumber).EndInit();;
         }
     }
             #endif
 }
Ejemplo n.º 28
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
    }
Ejemplo n.º 29
0
    public static void Create()
    {
        // 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("30aeaac5-eace-4f2b-a39d-c28318eb6d73")
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;

        // 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);
        OneSignal.IdsAvailable((id, tocken) => { Id = id; Tocken = tocken; });
    }
Ejemplo n.º 30
0
    private void Start()
    {
        OneSignal.StartInit("7994bb6b-6d39-4875-9107-6b4f6fc01d20")
        .HandleNotificationOpened(HandleNotificationOpened)
        .EndInit();

        OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
        ReklamScript.RewardedReklamAl();
        ReklamScript.BannerReklamAl();
        ReklamScript.InterstitialReklamAl();
        Invoke("BannerAc", 0.5f);
        if (BeforeScore != 0)
        {
            CurrentScoreTextTMPro.text = BeforeScore.ToString();
            score = BeforeScore;
        }
    }