void Awake() { GrowthPush.Initialize(1075, "IUblO1kYXwGRGBrXnXYwoOLN6ubKPjPe", GrowthPush.Environment.Development, true, "1000565500410"); GrowthPush.TrackEvent("Launch"); GrowthPush.SetDeviceTags(); GrowthPush.ClearBadge(); }
void Awake() { Growthbeat.GetInstance().Initialize(applicationId, credentialId); IntentHandler.GetInstance().AddNoopIntentHandler(); IntentHandler.GetInstance().AddUrlIntentHandler(); IntentHandler.GetInstance().AddCustomIntentHandler("GrowthbeatComponent", "HandleCustomIntent"); GrowthLink.GetInstance().Initialize(applicationId, credentialId); GrowthPush.GetInstance().RequestDeviceToken(senderId, environment); Growthbeat.GetInstance().Start(); }
private void PrivateInitialize(int applicationId, string secret, GrowthPush.Environment environment, bool debug, string senderId) { #if UNITY_ANDROID && !UNITY_EDITOR if (growthPush == null) return; AndroidJavaClass environmentClass = new AndroidJavaClass("com.growthpush.model.Environment"); AndroidJavaObject environmentObject = environmentClass.GetStatic<AndroidJavaObject>(environment == GrowthPush.Environment.Production ? "production" : "development"); AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"); growthPush.Call<AndroidJavaObject>("initialize", activity, applicationId, secret, environmentObject, debug); growthPush.Call<AndroidJavaObject>("register", senderId); #endif }
void Update() { #if UNITY_IPHONE if (!tokenSent) { byte[] token = NotificationServices.deviceToken; if (token != null) { GrowthPush.GetInstance().SetDeviceToken(System.BitConverter.ToString(token).Replace("-", "").ToLower()); tokenSent = true; } } #endif }
public static void Initialize(int applicationID, string secrect, GrowthPush.Environment environment, bool debug) { #if UNITY_IPHONE && !UNITY_EDITOR growthPushSetApplicationId(applicationID, secrect, (int)environment, debug); #endif }
public static void Initialize(int applicationId, string secret, GrowthPush.Environment environment, bool debug, string senderId) { instance.PrivateInitialize(applicationId, secret, environment, debug, senderId); }