Ejemplo n.º 1
0
    public void ShowPopUp(string title, string message)
    {
                #if DEBUG_INFO
        Debug.Log("AndroidManager: attempting to show a pop up");
                #endif

                #if UNITY_ANDROID
        AndroidMessage.Create(title, message);
                #endif
    }
Ejemplo n.º 2
0
 public void SuccsesPurchase()
 {
     if (GPaymnetManagerExample.isInited)
     {
         AndroidInAppPurchaseManager.instance.purchase(GPaymnetManagerExample.ANDROID_TEST_PURCHASED);
     }
     else
     {
         AndroidMessage.Create("Error", "PaymnetManagerExample not yet inited");
     }
 }
Ejemplo n.º 3
0
 public void FailPurchase()
 {
     if (GPaymnetManagerExample.isInited)
     {
         AndroidInAppPurchaseManager.instance.purchase(GPaymnetManagerExample.ANDROID_TEST_ITEM_UNAVAILABLE);
     }
     else
     {
         AndroidMessage.Create("Error", "PaymnetManagerExample not yet inited");
     }
 }
	private static void OnProductConsumed(CEvent e) {
		BillingResult result = e.data as BillingResult;
		
		if(result.isSuccess) {
			OnProcessingConsumeProduct (result.purchase);
		} else {
			AndroidMessage.Create("Product Cousume Failed", result.response.ToString() + " " + result.message);
		}
		
		Debug.Log ("Cousume Responce: " + result.response.ToString() + " " + result.message);
	}
Ejemplo n.º 5
0
 private void OnProductConsumed(BillingResult result)
 {
     if (result.IsSuccess)
     {
         AndroidMessage.Create(ProjectManager.billingTitle, ProjectManager.billingComplete);
         OnProcessingConsumeProduct(result.Purchase);
     }
     else
     {
         AndroidMessage.Create(ProjectManager.billingTitle, ProjectManager.billingError);
     }
 }
Ejemplo n.º 6
0
    //purchasing events
    private void OnProductPurchased(BillingResult result)
    {
        if (result.IsSuccess)
        {
            OnProcessingPurchasedProduct(result.Purchase);
        }

        else
        {
            AndroidMessage.Create("Product Purchase Failed", result.Response.ToString() + " " + result.Message);
        }
    }
    private void ActionMatchDataLoadedFunction(GP_TBM_LoadMatchResult result)
    {
        Debug_previous_method_name();
        AndroidMessage.Create("Loaded match data ", "loaad ");
        foreach (GP_Participant part in result.Match.Participants)
        {
            //  AndroidMessage.Create("Participant", "Participant info " + part.DisplayName + " +" + part.IconImageUrl + " id " + part.id + " pid " + part.playerId);
        }
        GP_TBM_Match match = result.Match;

        DealWithMatchData(match);
    }
    void initGame(GP_TBM_Match match)
    {
        AndroidMessage.Create("Initializing match data ", " match data initialization");
        List <string> playerIDS = new List <string>();

        foreach (GP_Participant participant in match.Participants)
        {
            playerIDS.Add(participant.id); //TODO katso onko playerID vai joku toinen ID
        }
        Common.roundInformation.InitializeGameData(playerIDS, match.Id);
        Common.cloudServiceMaster.CreateAlbumOnGameStarted();
    }
Ejemplo n.º 9
0
    private static void OnProductPurchased(BillingResult result)
    {
        if (result.IsSuccess)
        {
            OnProcessingPurchasedProduct(result.Purchase);

            AndroidMessage.Create(
                "Purchase",
                "Successfull purchase!",
                AndroidDialogTheme.ThemeHoloLight);
        }
    }
Ejemplo n.º 10
0
 private static void OnRetrieveProductsFinised(BillingResult result)
 {
     AndroidInAppPurchaseManager.ActionRetrieveProducsFinished -= OnRetrieveProductsFinised;
     if (result.IsSuccess)
     {
         UpdateStoreData();
         _isInited = true;
     }
     else
     {
         AndroidMessage.Create("Connection Responce", result.Response.ToString() + " " + result.Message);
     }
 }
Ejemplo n.º 11
0
    private void OnBillingConnected(BillingResult result)
    {
        AndroidInAppPurchaseManager.ActionBillingSetupFinished -= OnBillingConnected;

        if (!result.IsSuccess)
        {
            AndroidMessage msg = AndroidMessage.Create("Error!", "Error trying to connect to billing service");
        }
        else
        {
            AndroidMessage msg = AndroidMessage.Create("Connected", "Connected to billing service");
        }
    }
    //--------------------------------------
    // EVENTS
    //--------------------------------------

    private void ActionAdvertisingIdLoaded(GP_AdvertisingIdLoadResult res)
    {
        GooglePlayUtils.ActionAdvertisingIdLoaded -= ActionAdvertisingIdLoaded;

        if (res.IsSucceeded)
        {
            AndroidMessage.Create("Succeeded", "Advertising Id: " + res.id);
        }
        else
        {
            AndroidMessage.Create("Failed", "Advertising Id failed to loaed");
        }
    }
Ejemplo n.º 13
0
    private static void OnProductConsumed(BillingResult result)
    {
        if (result.IsSuccess)
        {
            OnProcessingConsumeProduct(result.Purchase);
        }
        else
        {
            AndroidMessage.Create("Product Cousume Failed", result.Response.ToString() + " " + result.Message);
        }

        Debug.Log("Cousume Responce: " + result.Response.ToString() + " " + result.Message);
    }
    private static void OnBillingConnected(BillingResult result)
    {
        AndroidInAppPurchaseManager.ActionBillingSetupFinished -= OnBillingConnected;

        if (result.IsSuccess)
        {
            //Store connection is Successful. Next we loading product and customer purchasing details
            AndroidInAppPurchaseManager.Client.RetrieveProducDetails();
            AndroidInAppPurchaseManager.ActionRetrieveProducsFinished += OnRetrieveProductsFinised;
        }

        AndroidMessage.Create("Connection Responce", result.Response.ToString() + " " + result.Message);
        Debug.Log("Connection Responce: " + result.Response.ToString() + " " + result.Message);
    }
    private static void OnProductPurchased(BillingResult result)
    {
        if (result.IsSuccess)
        {
            AndroidMessage.Create("Product Purchased", result.Purchase.SKU + "\n Full Response: " + result.Purchase.OriginalJson);
            OnProcessingPurchasedProduct(result.Purchase);
        }
        else
        {
            AndroidMessage.Create("Product Purchase Failed", result.Response.ToString() + " " + result.Message);
        }

        Debug.Log("Purchased Responce: " + result.Response.ToString() + " " + result.Message);
    }
Ejemplo n.º 16
0
    private static void OnProductConsumed(BillingResult result)
    {
        if (result.isSuccess)
        {
            AndroidMessage.Create("Product Consumed", result.purchase.SKU + "\n Full Response: " + result.purchase.originalJson);
            OnProcessingConsumeProduct(result.purchase);
        }
        else
        {
            AndroidMessage.Create("Product Cousume Failed", result.response.ToString() + " " + result.message);
        }

        Debug.Log("Cousume Responce: " + result.response.ToString() + " " + result.message);
    }
Ejemplo n.º 17
0
    private static void OnFacebookPackageCheckResult(AN_PackageCheckResult res)
    {
        if (res.IsSucceeded)
        {
            //if is installed lest shared it
            AndroidSocialGate.StartShareIntent(_shareTitle, _shareContent + " " + _playStoreURL, defaultImageToShare, "facebook.katana");
        }

        else
        {
            AndroidMessage msg = AndroidMessage.Create("Share error!", "Please before install facebook app");
        }

        AndroidNativeUtility.OnPackageCheckResult -= OnFacebookPackageCheckResult;
    }
	private static void OnRetriveProductsFinised(CEvent e) {
		BillingResult result = e.data as BillingResult;
		AndroidInAppPurchaseManager.instance.removeEventListener (AndroidInAppPurchaseManager.ON_RETRIEVE_PRODUC_FINISHED, OnRetriveProductsFinised);
		
		if(result.isSuccess) {

			UpdateStoreData();
			_isInited = true;


		} else {
			AndroidMessage.Create("Connection Responce", result.response.ToString() + " " + result.message);
		}

	}
	private static void OnBillingConnected(CEvent e) {
		BillingResult result = e.data as BillingResult;
		AndroidInAppPurchaseManager.instance.removeEventListener (AndroidInAppPurchaseManager.ON_BILLING_SETUP_FINISHED, OnBillingConnected);
		
		
		if(result.isSuccess) {
			//Store connection is Successful. Next we loading product and customer purchasing details
			AndroidInAppPurchaseManager.instance.addEventListener (AndroidInAppPurchaseManager.ON_RETRIEVE_PRODUC_FINISHED, OnRetriveProductsFinised);
			AndroidInAppPurchaseManager.instance.retrieveProducDetails();

		} 
		
		AndroidMessage.Create("Connection Responce", result.response.ToString() + " " + result.message);
		Debug.Log ("Connection Responce: " + result.response.ToString() + " " + result.message);
	}
Ejemplo n.º 20
0
    private void ActionGameSaveResult(GP_SpanshotLoadResult result)
    {
        GooglePlaySavedGamesManager.ActionGameSaveResult -= ActionGameSaveResult;
        Debug.Log("ActionGameSaveResult: " + result.Message);

        if (result.IsSucceeded)
        {
            SA_StatusBar.text = "Games Saved: " + result.Snapshot.meta.Title;
        }
        else
        {
            SA_StatusBar.text = "Games Save Failed";
        }

        AndroidMessage.Create("Game Save Result", SA_StatusBar.text);
    }
    private void ActionGameSaveResult(GP_SpanshotLoadResult result)
    {
        GooglePlaySavedGamesManager.ActionGameSaveResult -= ActionGameSaveResult;
        Debug.Log("ActionGameSaveResult: " + result.Message);

        AndroidNativeUtility.HidePreloader();
        if (result.IsSucceeded)
        {
            AndroidMessage.Create("Game saved", "Data: " + result.Snapshot.stringData);
        }
        else
        {
            Debug.Log("ActionGameSaveResult Error : Games Save Failed");
            AndroidMessage.Create("\"City Car Run\" Error", "Game Data Save Failed");
        }
    }
    private void ActionGameSaveLoaded(GP_SpanshotLoadResult result)
    {
        Debug.Log("ActionGameSaveLoaded: " + result.Message);
        if (result.IsSucceeded)
        {
            Debug.Log("Snapshot.Title: " + result.Snapshot.meta.Title);
            Debug.Log("Snapshot.Description: " + result.Snapshot.meta.Description);
            Debug.Log("Snapshot.CoverImageUrl): " + result.Snapshot.meta.CoverImageUrl);
            Debug.Log("Snapshot.LastModifiedTimestamp: " + result.Snapshot.meta.LastModifiedTimestamp);

            Debug.Log("Snapshot.stringData: " + result.Snapshot.stringData);
            Debug.Log("Snapshot.bytes.Length: " + result.Snapshot.bytes.Length);

            AndroidNativeUtility.HidePreloader();
            AndroidMessage.Create("Snapshot Loaded", "Data: " + result.Snapshot.stringData);
        }
    }
Ejemplo n.º 23
0
    private static void OnRetrieveProductsFinised(BillingResult result)
    {
        AndroidInAppPurchaseManager.ActionRetrieveProducsFinished -= OnRetrieveProductsFinised;


        if (result.isSuccess)
        {
            _isInited = true;
            AndroidMessage.Create("Success", "Billing init complete inventory contains: " + AndroidInAppPurchaseManager.instance.inventory.purchases.Count + " products");
        }
        else
        {
            AndroidMessage.Create("Connection Responce", result.response.ToString() + " " + result.message);
        }

        Debug.Log("Connection Responce: " + result.response.ToString() + " " + result.message);
    }
Ejemplo n.º 24
0
    private void ActionGameSaveLoaded(GP_SpanshotLoadResult result)
    {
        Debug.Log("ActionGameSaveLoaded: " + result.message);
        if (result.isSuccess)
        {
            Debug.Log("Snapshot.Title: " + result.Snapshot.meta.Title);
            Debug.Log("Snapshot.Description: " + result.Snapshot.meta.Description);
            Debug.Log("Snapshot.CoverImageUrl): " + result.Snapshot.meta.CoverImageUrl);
            Debug.Log("Snapshot.LastModifiedTimestamp: " + result.Snapshot.meta.LastModifiedTimestamp);

            Debug.Log("Snapshot.stringData: " + result.Snapshot.stringData);
            Debug.Log("Snapshot.bytes.Length: " + result.Snapshot.bytes.Length);

            AndroidMessage.Create("Snapshot Loaded", "Data: " + result.Snapshot.stringData);
        }

        SA_StatusBar.text = "Games Loaded: " + result.message;
    }
Ejemplo n.º 25
0
 public void ConsumeProduct()
 {
     if (GPaymnetManagerExample.isInited)
     {
         if (AndroidInAppPurchaseManager.instance.inventory.IsProductPurchased(GPaymnetManagerExample.ANDROID_TEST_PURCHASED))
         {
             GPaymnetManagerExample.consume(GPaymnetManagerExample.ANDROID_TEST_PURCHASED);
         }
         else
         {
             AndroidMessage.Create("Error", "You do not own product to consume it");
         }
     }
     else
     {
         AndroidMessage.Create("Error", "PaymnetManagerExample not yet inited");
     }
 }
    private static void OnRetriveProductsFinised(CEvent e)
    {
        BillingResult result = e.data as BillingResult;

        AndroidInAppPurchaseManager.instance.removeEventListener(AndroidInAppPurchaseManager.ON_RETRIEVE_PRODUC_FINISHED, OnRetriveProductsFinised);

        if (result.isSuccess)
        {
            _isInited = true;
            AndroidMessage.Create("Success", "Billing init complete inventory contains: " + AndroidInAppPurchaseManager.instance.inventory.purchases.Count + " products");
        }
        else
        {
            AndroidMessage.Create("Connection Responce", result.response.ToString() + " " + result.message);
        }

        Debug.Log("Connection Responce: " + result.response.ToString() + " " + result.message);
    }
    void HandleMatchDataReceived(string senderId, byte[] data)
    {
        string str = string.Empty;

#if !UNITY_WP8 && !UNITY_WSA
        System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
        str = enc.GetString(data);
#endif
        string name = senderId;

        UM_RTM_Participant p = RTM.Matchmaker.CurrentRoom.GetParticipantById(senderId);
        if (p != null)
        {
            name = p.Name;
        }

        AndroidMessage.Create("Data Eeceived", "player " + name + " \n " + "data: " + str);
    }
Ejemplo n.º 28
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------


    //--------------------------------------
    //  PUBLIC METHODS
    //--------------------------------------


    void OnGUI()
    {
        if (GUI.Button(new Rect(10, 10, 150, 50), "Rate Dialog PopUp"))
        {
            AndroidRateUsPopUp rate = AndroidRateUsPopUp.Create("Rate Us", rateText, rateUrl);
            rate.addEventListener(BaseEvent.COMPLETE, OnRatePopUpClose);
        }


        if (GUI.Button(new Rect(10, 70, 150, 50), "Dialog PopUp"))
        {
            AndroidDialog dialog = AndroidDialog.Create("Dialog Titile", "Dialog message");
            dialog.addEventListener(BaseEvent.COMPLETE, OnDialogClose);
        }

        if (GUI.Button(new Rect(10, 130, 150, 50), "Message PopUp"))
        {
            AndroidMessage msg = AndroidMessage.Create("Message Titile", "Message message");
            msg.addEventListener(BaseEvent.COMPLETE, OnMessageClose);
        }
    }
    void ActionMatchInitiated(GP_TBM_MatchInitiatedResult result)
    {
        Debug_previous_method_name();
        unShowLoadingPopUp();

        if (!result.IsSucceeded)
        {
            AndroidMessage.Create("Match Initi Failed", "Status code: " + result.Response);
            return;
        }


        // If this player is not the first player in this match, continue.
        AndroidMessage.Create("Match Initiated ", "Status code: " + result.Response);
        int counter = 0;

        GP_TBM_Match Match = result.Match;

        mMatch = result.Match;
        DealWithMatchData(mMatch);
    }
Ejemplo n.º 30
0
	private static void OnProductPurchased(BillingResult result) {

		//this flag will tell you if purchase is available
		//result.isSuccess


		//infomation about purchase stored here
		//result.purchase

		//here is how for example you can get product SKU
		//result.purchase.SKU

		
		if(result.isSuccess) {
			OnProcessingPurchasedProduct (result.purchase);
		} else {
			AndroidMessage.Create("Product Purchase Failed", result.response.ToString() + " " + result.message);
		}
		
		Debug.Log ("Purchased Responce: " + result.response.ToString() + " " + result.message);
	}