Search Unity

[Released] Android Native Plugin

Discussion in 'Assets and Asset Store' started by stanislav-osipov, Sep 20, 2013.

  1. firativerson

    firativerson

    Joined:
    Jan 22, 2015
    Posts:
    33
    Hello, I am wondering if I could respond to event requests from fb. Such as marking myself as going from given link
     
  2. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Hello,
    I am not sure, that I 100% understand you.

    Please, provide me the use-case of the scenario you described.
    What API do you need for this case?

    Best regards,
    Alex
     
  3. jackishere

    jackishere

    Joined:
    Mar 1, 2014
    Posts:
    22
    Hello I have emailed support yesterday but I'll post it again just incase

    I'm getting too many method references build error after adding android native. I wonder if there's anyway to fix this without using multidex. We are trying to keep the build workflow done via unity if possible.

    we are only using image sharing, achievements, leaderboards, if it's possible to remove the unused references? or maybe a lite version of the plugins
     
  4. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    I want to get the welcome toast every time a player logs into my game. However this toast does not show (even though I have checked the "show connecting popup") Is there some way to forcibly show this welcome toast when I want?`

    It is this toast that I am talking about:
    WelcomeToast.png
     
  5. ctdlgames

    ctdlgames

    Joined:
    Jul 27, 2016
    Posts:
    2
    Hi! I am using this plugin and almost everything works fine. I am struggling to get localized prices for my In Apps. I am following the workflow presented in documentation:
    1. initialise google play connection
    2. initialise in app purchases manager
    3. retrieve product details
    after this when I'am accesing AndroidInAppPurchaseManager.Client.Inventory.Products the prize and localizedPrize is always 0.99. I'am sure I got it set up in Google Play store correctly cause android native popup shows correct localized price. Am I doing something wrong?
     
  6. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Hello,
    The plugin has the options to reduce its functionality included into final application build.
    So, the common approach is to open the plugin settings and disable all the features you don't use for your project.
    Just be sure, that the features you use are enabled in Android Native Settings Inspector window.
     
  7. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Hello,
    Unfortunately, we can't control this Welcome PopUp.
    There is NO Google Play Services API for such a case.

    You can try to use our method use ClearDefaultAccount and uncheck field in Play Services application -> Automatically login with the current user option enabled.
    I think, that's the use-case you are looking for.
     
  8. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Hello,
    It's quite hard to help you with this case in a forum circumstances.
    Please, you better contact Stan's Assets Support Team directly with this case via support@stansassets.com
    You will get great assistance with any case in a short time.
     
  9. ctdlgames

    ctdlgames

    Joined:
    Jul 27, 2016
    Posts:
    2
    I did about a week ago and again yesterday. This is the last thing that's keeping me from releasing my game for android so please respond. :)
     
  10. jackishere

    jackishere

    Joined:
    Mar 1, 2014
    Posts:
    22
    Hi Alex i have updated the plugins but there's still slight issue of the leaderboards and achievements panel is not showing and several other issues like resources not updatings
     
  11. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    @AlexRay Hi I have a strange thing when logging into google play.

    If I login using GooglePlayConnection.Instance.Connect(), it behaves as I would expect. The attached screenshot image with the "Google Play Signin" appears.
    GPLogin.jpg

    However if I login using GooglePlayConnection.Instance.Connect("my-account-name") the same popup dialog does not appear. I have tried to look a bit at the java code, and the only real difference I can see is that in GooglePlaySupportActivity.java - line 139, it says "i.putExtra(BRIDGED_ACCOUNT_KEY, account);" and the only difference is that when the account is null, the popup is shown, and when the account is an actual account name, the popup is NOT shown.

    Is there anything we can do about this if I want to show the popup in both scenarios?

    EDIT: Just to clarify, I can clear settings after each login and when no account name is supplied it shows the popup every time. And when an account name is supplied it logs in silently without the popup every time.

    Best regards
    Peter
     
  12. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    What kind of issues do you have in your project?
    Please, provide as detailed description as you can.
     
  13. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    You are facing the entirely correct behavior of Google Play Services login.
    In the case of no account name provided you will see this Google Play Games popup and the user will be prompted to select the appropriate account for login. Because a large part of players have multiple accounts for Google Play on their devices.
    But if you manually provide the account name for login, the user should not be bothered about it and the Google Play Games popup will not be displayed.

    All these cases you described here depends on your own particular Google Play Services login implementation.
    That's not an issue cases. Just the behavior depending on your implemented login logic.
     
  14. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    You l will get the reply of support engineer via e-mail.
    Thank you for your patience and understanding!
     
  15. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    Hi Alex, my problem is that I have (for testing purposes) two accounts, and it does not let me select which one to use - if I just sign in (not supplying the account) it signs in default with the first one it seems (and shows the popup) - it does not let me select. However if i retrieve the different accounts and select one manually it signs in "silently".

    I have also sent an email with two log files where the differences can be compared.

    As I understand what you say I should be allowed to choose which account I want to login with if I have more than 1 right?
     
  16. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    On closer inspection, I do not get the option to select account on my Android Phone, however when testing the exact same apk on my android Tablet - i do get the option to select account. Do you know why that might be? some setting in the phone I have missed perhaps?
     
  17. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    Nevermind... it was my mistake :) I was calling disconnect, I got the behaviour I wantet when I called GooglePlusAPI.Instance.ClearDefaultAccount()...

    As your documentation says.. sorry ;)

    Edit: a little too fast it seems... I do not get the option to select account still.. For testing I have made a simple scene with two buttons one that calls GooglePlayConnection.Instance.Connect(); and one that calls GooglePlusAPI.Instance.ClearDefaultAccount();
    It connects and disconnects fine, but when it connects i do NOT get the option to select account. What am I missing is there something more I should clear?

    As a side note if i connect and go into leaderboard (the google play popup leaderboard) and sign out from google play manually in the settings located in the upper right corner. THEN i do get the option to select account next time i logon.
     
    Last edited: Aug 26, 2016
  18. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Hello,
    The situation with Clear Default Account is following.
    I made a lot of testing on my side with this API and found out the reason for such behaviour.
    There is the following configuration in Play Games application on every Android device.

    screen9.png
    Let assume next testing scenario:
    1. Use this account to sign in option enabled.
    2. I have A, B, C accounts on my Android device.
    3. Sign into Google Play Services with account B. Use this account to sign in option is enabled for this account in Play Games application.
    4. Close the application.
    5. Open the application again and sign into Google Play Services.
    6. I'll automatically sign is with account B as in my previous game session.
    7. Press Clear Default Account button.
    8. Close the application.
    9. Open the application again and sign into Google Play Services.
    10. I'll automatically sign is with account B as in my previous game session. The reason of this is exactly Use this account to sign in option.
    Testing scenario 2:
    1. Use this account to sign in option disabled.
    2. I have the same A, B, C accounts on my Android device.
    3. Sign into Google Play Services with account B. I will be prompted to select a certain account to login.
    4. Close the application.
    5. Open the application again and sign into Google Play Services.
    6. I'll automatically sign is with account B as in my previous game session.
    7. Press Clear Default Account button.
    8. Close the application.
    9. Open the application again and sign into Google Play Services.
    10. I'll be prompted to select a certain account to login into Google Play Services.
    Please, try these testing scenarios on your own.
    So, after such kind of testing, you will make some decisions about Clear Default Account API call and Play Games application settings.

    Best regards,
    Alex
     
    Ramsdal likes this.
  19. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    Hi Alex,

    This was my "problem" weird the other program i tested does not respect this setting. Since it showed both accounts, through some debugging I found that it was using prime31 tool for the android part. Anyway this makes most sence since it is respecting the android settings (that I was not aware of).

    Thanks! :)
     
  20. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Glad to know that all the issues have been fixed and you are ready to go with your project!
     
  21. RakshithAnand

    RakshithAnand

    Joined:
    Jun 30, 2013
    Posts:
    56
    This is unfortunately not happening(probably because it signs in in a separate activity) but since it does not show almost all the times, I created my own Welcome Back Notification fetching the Players Icon. :D ..
     
  22. stevenatunity

    stevenatunity

    Joined:
    Apr 17, 2015
    Posts:
    114
    @RakshithAnand @AlexRay I'm interested in how you fetch the Players Icon when the player logs in in to game services :) I use PlayMaker, but I'm sure I could make an action if I could see some example code :p
     
  23. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Hello,
    I don't think we have the Playmaker action with this functionality.
    Anyway, the best way is to contact Stan's Assets Support Team and request the new Playmaker action you want.
    So, please, go for it. You will get your Playmaker action in a short time.
     
  24. stevenatunity

    stevenatunity

    Joined:
    Apr 17, 2015
    Posts:
    114
    Thanks, Alex :)
     
  25. jackishere

    jackishere

    Joined:
    Mar 1, 2014
    Posts:
    22
    The problem has been resolved thanks for the support!
     
  26. Chintao

    Chintao

    Joined:
    Jun 26, 2014
    Posts:
    54
    Hi Alex!
    I have a Problem with Save Game.
    In My Game i use Save Game to store the amount of Games Left, so the player can always get their Games.
    So i always have the Title and the Discription as "a" and i overwrite it everytime the Amount of Left Games changes.

    When i call CreateNewSnapshot with a String Data, then i have no Problems:
    Code (CSharp):
    1. GooglePlaySavedGamesManager.instance.CreateNewSnapshot(name, name, texture, gamesString, TotalPlayedTime);
    But if i call CreateNewSnapshot with a Byte[] as Data, then i always get a Conflic that will be resolved trough your example, but the resolve always end up in ActionGameSaveLoaded and it doesn't have saved my Data.

    Code (CSharp):
    1. GooglePlaySavedGamesManager.instance.CreateNewSnapshot(name, name, texture, bytesToSend, TotalPlayedTime);
    Am i doing soemthing wrong?
     
  27. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Please, could you provide me more additional information according to this case?
    The best way is to provide the code for both cases - when you save your data as a string and when you save the data as the byte array.
    Any additional description for the actions you perform while testing will be useful in this case.
    Also, please, provide the information how many devices do you use for a test and what is the step-by-step reproduction route for this case.
     
  28. Chintao

    Chintao

    Joined:
    Jun 26, 2014
    Posts:
    54
    ok so case 1: everything is working:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Linq;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5.  
    6. public class SaveGames : MonoBehaviour {
    7.  
    8.     public Texture2D texture;
    9.  
    10.     string loadString;
    11.  
    12.     InAppPurchase_Manager purchaseManager;
    13.  
    14.     void Awake()
    15.     {
    16.         purchaseManager = GetComponent<InAppPurchase_Manager>();
    17.     }
    18.  
    19.     void Start() {
    20.  
    21.         GooglePlaySavedGamesManager.ActionGameSaveLoaded += ActionGameSaveLoaded;
    22.         GooglePlaySavedGamesManager.ActionConflict += ActionConflict;
    23.     }
    24.  
    25.     void OnDestroy() {
    26.  
    27.         GooglePlaySavedGamesManager.ActionGameSaveLoaded -= ActionGameSaveLoaded;
    28.         GooglePlaySavedGamesManager.ActionConflict -= ActionConflict;
    29.  
    30.     }
    31.  
    32.     //--------------------------------------
    33.     // PUBLIC METHODS
    34.     //--------------------------------------
    35.  
    36.     public void CreateNewSnapshot(string name, int games) {
    37.  
    38.         Debug.Log("CREATE NEW SNAPSHOT");
    39.         string gamesString = games.ToString();
    40.         long TotalPlayedTime = 1;
    41.  
    42.         GooglePlaySavedGamesManager.ActionGameSaveResult += ActionGameSaveResult;
    43.         GooglePlaySavedGamesManager.instance.CreateNewSnapshot(name, name, texture, gamesString, TotalPlayedTime);
    44.     }
    45.  
    46.     public void LoadSavedGames(string stringToLoad) {
    47.  
    48.         loadString = stringToLoad;
    49.  
    50.         GooglePlaySavedGamesManager.ActionAvailableGameSavesLoaded += ActionAvailableGameSavesLoaded;
    51.         GooglePlaySavedGamesManager.instance.LoadAvailableSavedGames();
    52.     }
    53.  
    54.     private void ActionAvailableGameSavesLoaded (GooglePlayResult res) {
    55.  
    56.         GooglePlaySavedGamesManager.ActionAvailableGameSavesLoaded -= ActionAvailableGameSavesLoaded;
    57.         if(res.IsSucceeded) {
    58.             GooglePlaySavedGamesManager.instance.LoadSpanshotByName(loadString);
    59.  
    60.         } else {
    61.             AndroidMessage.Create("Etwas ist schief gelaufen", "Versuche dich erneut einzuloggen!");
    62.         }
    63.     }
    64.  
    65.     //--------------------------------------
    66.     // EVENTS
    67.     //--------------------------------------
    68.  
    69.     private void ActionGameSaveLoaded (GP_SpanshotLoadResult result) {
    70.  
    71.         Debug.Log("ActionGameSaveLoaded: " + result.Message);
    72.         if(result.IsSucceeded) {
    73.  
    74.             Debug.Log("Snapshot.Title: "                     + result.Snapshot.meta.Title);
    75.             Debug.Log("Snapshot.Description: "                 + result.Snapshot.meta.Description);
    76.             Debug.Log("Snapshot.CoverImageUrl: "             + result.Snapshot.meta.CoverImageUrl);
    77.             Debug.Log("Snapshot.LastModifiedTimestamp: "     + result.Snapshot.meta.LastModifiedTimestamp);
    78.  
    79.             Debug.Log("Snapshot.stringData: "                 + result.Snapshot.stringData);
    80.             Debug.Log("Snapshot.bytes.Length: "             + result.Snapshot.bytes.Length);
    81.  
    82.             Debug.Log("loadstring: " + loadString);
    83.  
    84.             if (loadString == "b") {
    85.  
    86.                 //            AndroidMessage.Create("Snapshot Loaded", "Data: " + result.Snapshot.stringData +"\n" + "Data as Int: " + resultInt);
    87.                 int resultInt = int.Parse (result.Snapshot.stringData);
    88.                 purchaseManager.multiplayerGamesLeft = resultInt;
    89.                 purchaseManager.isLoaded = true;
    90.                 Debug.Log ("ONLINE MPG LEFT: " + resultInt);
    91.             }
    92.  
    93.  
    94.         else
    95.         {
    96.             Debug.Log("saveGame doesn't exist!");
    97.         }
    98.         }
    99.     }
    100.  
    101.     private void ActionGameSaveResult (GP_SpanshotLoadResult result) {
    102.         GooglePlaySavedGamesManager.ActionGameSaveResult -= ActionGameSaveResult;
    103.         Debug.Log("ActionGameSaveResult: " + result.Message);
    104.  
    105.         if(result.IsSucceeded) {
    106.  
    107.         } else {
    108.  
    109.         }
    110.     }  
    111.  
    112.     private void ActionConflict (GP_SnapshotConflict result) {
    113.  
    114.         Debug.Log("Conflict Detected: ");
    115.  
    116.         GP_Snapshot snapshot = result.Snapshot;
    117.         GP_Snapshot conflictSnapshot = result.ConflictingSnapshot;
    118.  
    119.         // Resolve between conflicts by selecting the newest of the conflicting snapshots.
    120.         GP_Snapshot mResolvedSnapshot = snapshot;
    121.  
    122.         if (snapshot.meta.LastModifiedTimestamp < conflictSnapshot.meta.LastModifiedTimestamp) {
    123.             mResolvedSnapshot = conflictSnapshot;
    124.         }
    125.  
    126.         result.Resolve(mResolvedSnapshot);
    127.     }
    case2: creates a conflict and then goes into ActionGameSaveLoaded:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Linq;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5.  
    6. public class SaveGames : MonoBehaviour {
    7.  
    8.     public Texture2D texture;
    9.     byte[] bytesToSend = new byte[2];
    10.  
    11.     InAppPurchase_Manager purchaseManager;
    12.  
    13.     void Awake()
    14.     {
    15.         purchaseManager = GetComponent<InAppPurchase_Manager>();
    16.     }
    17.  
    18.     void Start() {
    19.  
    20.         GooglePlaySavedGamesManager.ActionGameSaveLoaded += ActionGameSaveLoaded;
    21.         GooglePlaySavedGamesManager.ActionConflict += ActionConflict;
    22.     }
    23.  
    24.     void OnDestroy() {
    25.  
    26.         GooglePlaySavedGamesManager.ActionGameSaveLoaded -= ActionGameSaveLoaded;
    27.         GooglePlaySavedGamesManager.ActionConflict -= ActionConflict;
    28.  
    29.     }
    30.  
    31.     //--------------------------------------
    32.     // PUBLIC METHODS
    33.     //--------------------------------------
    34.  
    35.     public void CreateNewSnapshot( int gamesLeft, int gamesPlayed) {
    36.  
    37.         string name = "a";
    38.  
    39.         bytesToSend[0] = (byte)gamesLeft;
    40.         bytesToSend[1] = (byte)gamesPlayed;
    41.  
    42.  
    43.         Debug.Log("CREATE NEW SNAPSHOT" + "\n" + "gamesLeft: " + bytesToSend[0] + "\n" + "gamesPlayed: "+ bytesToSend[1]);
    44.         long TotalPlayedTime = 1;
    45.  
    46.         GooglePlaySavedGamesManager.ActionGameSaveResult += ActionGameSaveResult;
    47.         GooglePlaySavedGamesManager.instance.CreateNewSnapshot(name, name, texture, bytesToSend, TotalPlayedTime);
    48.     }
    49.  
    50.     public void LoadSavedGames() {
    51.  
    52.         GooglePlaySavedGamesManager.ActionAvailableGameSavesLoaded += ActionAvailableGameSavesLoaded;
    53.         GooglePlaySavedGamesManager.instance.LoadAvailableSavedGames();
    54.     }
    55.  
    56.     private void ActionAvailableGameSavesLoaded (GooglePlayResult res) {
    57.  
    58.         GooglePlaySavedGamesManager.ActionAvailableGameSavesLoaded -= ActionAvailableGameSavesLoaded;
    59.         if(res.IsSucceeded) {
    60.  
    61.             if(GooglePlaySavedGamesManager.instance.AvailableGameSaves.Count > 0) {
    62.  
    63.                 GooglePlaySavedGamesManager.instance.LoadSpanshotByName("a");
    64.                 Debug.Log ("LOAD SNAPSHOT!");
    65.             }
    66.             else
    67.             {
    68.                 Debug.Log ("AvailableGameSaves.Count == 0: first login");
    69.                 purchaseManager.MultiplayerGamesIncrease (9);
    70.             }
    71.  
    72.         } else {
    73.             AndroidMessage.Create("Etwas ist schief gelaufen", "Versuche dich erneut einzuloggen!");
    74.         }
    75.     }
    76.  
    77.     //--------------------------------------
    78.     // EVENTS
    79.     //--------------------------------------
    80.  
    81.     private void ActionGameSaveLoaded (GP_SpanshotLoadResult result)
    82.     {
    83.  
    84.         Debug.Log ("ActionGameSaveLoaded: " + result.Message);
    85.         if (result.IsSucceeded) {
    86.  
    87.             Debug.Log ("Snapshot.Title: " + result.Snapshot.meta.Title);
    88.             Debug.Log ("Snapshot.Description: " + result.Snapshot.meta.Description);
    89.             Debug.Log ("Snapshot.CoverImageUrl: " + result.Snapshot.meta.CoverImageUrl);
    90.             Debug.Log ("Snapshot.LastModifiedTimestamp: " + result.Snapshot.meta.LastModifiedTimestamp);
    91.  
    92.             //            Debug.Log ("Snapshot.stringData: " + result.Snapshot.stringData);
    93.             Debug.Log ("Snapshot.bytes.Length: " + result.Snapshot.bytes.Length);
    94.  
    95.             byte[] resultByte = result.Snapshot.bytes;
    96.  
    97.             Debug.Log ("ONLINE MPG LEFT: " + resultByte [0]);
    98.             Debug.Log ("ONLINE GAMES PLAYED: " + resultByte [1]);
    99.  
    100.             purchaseManager.multiplayerGamesLeft = resultByte [0];
    101.             purchaseManager.gamesPlayed = resultByte [1];
    102.  
    103.             purchaseManager.isLoaded = true;
    104.             purchaseManager.spLoaded = true;
    105.  
    106.         } else {
    107.             Debug.Log ("saveGame doesn't exist!");
    108.         }
    109.     }
    110.  
    111.     private void ActionGameSaveResult (GP_SpanshotLoadResult result) {
    112.         GooglePlaySavedGamesManager.ActionGameSaveResult -= ActionGameSaveResult;
    113.         Debug.Log("ActionGameSaveResult: " + result.Message);
    114.  
    115.         if(result.IsSucceeded) {
    116.  
    117.         } else {
    118.  
    119.         }
    120.     }  
    121.  
    122.     private void ActionConflict (GP_SnapshotConflict result) {
    123.  
    124.         Debug.Log("Conflict Detected: ");
    125.  
    126.         GP_Snapshot snapshot = result.Snapshot;
    127.         GP_Snapshot conflictSnapshot = result.ConflictingSnapshot;
    128.  
    129.         // Resolve between conflicts by selecting the newest of the conflicting snapshots.
    130.         GP_Snapshot mResolvedSnapshot = snapshot;
    131.  
    132.         if (snapshot.meta.LastModifiedTimestamp < conflictSnapshot.meta.LastModifiedTimestamp) {
    133.             mResolvedSnapshot = conflictSnapshot;
    134.         }
    135.  
    136.         result.Resolve(mResolvedSnapshot);
    137.     }
    138. }
    If i run the second code, i can't update the saved game with new data. On the overall first call, it works, but after that it gives a conflict and the result doesn't end up to be saved, it jumps into ActionGameSaveLoaded.
    but with the first code, with the string, i can update it.
     
  29. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    I didn't test your code on my own, but at first glance, your code looks correct.
    Anyway, it's only at the first glance. Most likely I'll test it on my own sample.

    Please, could you provide me the testing scenario for this case?
    As mush detailed information as you can. All the reproduction steps, all the devices description.
    Do you use the only one device for a test or you have several devices?
     
  30. Chintao

    Chintao

    Joined:
    Jun 26, 2014
    Posts:
    54
    So, i tried on 3 different devices, with 2 different Google Accounts. Nexus 5, Nexus 7 and One Plus 3.
    The player can't change the Save game on their own, cause i just use it to store "games played" and "games left".
    There are 2 scenarios, where the Save game changes:
    1. when the player decides to buy more games with real money.
    2. when the player plays singleplayer. after every singleplayer game "games played" increment by 1 until 3, then "games left" increment by 1 and "games played" are back at 0.

    The overall first save is working, the change only work with the string code, not with the byte[] code.
    name is in both situations always "a".
    texture is in both situations always a 1 px black image.
    total time played is in both situations always 1.

    in the log i see something like (with the second code aka byte[]):
    1. the Save Game method is called.
    2. There is a conflict.
    3. Load game is called with the old data.


    Thanks for your help!

    edit: there is one more scenario: when the player played 1 MP game and the "games played" decreases by 1.
     
    Last edited: Sep 8, 2016
  31. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Please, answer my question as precisely as you can.
    It's hard for me to help because I have not enough detailed information for this case.
    So, please, provide me the testing scenario description.
    All the actions step-by-step to make me able to reproduce it.

    Another approach, in this case, is to contact Stan's Assets Support Team, provide all the required information and ask for assistance. Please, feel free to contact support team. You will get the great assistance in a short time.
     
  32. Chintao

    Chintao

    Joined:
    Jun 26, 2014
    Posts:
    54
    I don't know, what exaclty do you need to know.
    whenever i call the "CreateNewSnapshot()" it happens. doesn't matter where or when.
    I call it like CreateNewSnapshot(1,1); then there is a conflict, then it doesn't get saved and instead the logoutput from "ActionGameSaveLoaded()" can be seen
     
  33. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    I need to know the testing scenario to reproduce the issue you have.
    So, I need the step-by-step actions from you. I am not able to reproduce this on my own.
    Looking forward to your reply.
     
    Last edited: Sep 9, 2016
  34. Chintao

    Chintao

    Joined:
    Jun 26, 2014
    Posts:
    54
    Thanks for your time, it seems like, i got the problem, cause at first i saved it as string and then switched to byte[] but still used the same title and description.
    I changed that and now it's working.
    sry for wasting your time!

    EDIT: ok, i have to disturb you again!
    If i save, everything works now, but when i load, it don't load the data from the last one, it loads the data from the previous one.
    example:
    i save the first time with 1 and 2 in the byte[]
    i save the second time with 2 and 3 in byte[]
    i load the snapshot with:
    Code (CSharp):
    1. GP_SnapshotMeta s =  GooglePlaySavedGamesManager.instance.AvailableGameSaves[0];
    2.                 GooglePlaySavedGamesManager.instance.LoadSpanshotByName(s.Title);
    but the outcome isn't 2 and 3, instead the outcome is 1 and 2!
    if i save again with 3 and 4 and load again, the outcome is 2 and 3.
    and so on!
     
    Last edited: Sep 9, 2016
  35. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Did you test our sample provided with the plugin?
    Please, test it on your own with your set of devices and check the result.
    If the result will be ok, then, please, try to make the similar implementation for your project.
    Otherwise, contact support team for further assistance.
     
  36. Chintao

    Chintao

    Joined:
    Jun 26, 2014
    Posts:
    54
    It's happening with the example scene as well! i just changed some small thing in the example code, so the random number is generated before the string is send, so i can see the exact number. after i save the data the number always is the second last number i have saved!
     
  37. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Hello,
    It's quite hard to help you in a forum circumstances and I think we are loosing time in such a way.
    So, you better contact the support team, send the project with this issue reproduced and ask for an assistance.
    Provide your code for setting up game save data for both cases (string and bytes).
    You will get great assistance in a short time with this case.
     
  38. Chintao

    Chintao

    Joined:
    Jun 26, 2014
    Posts:
    54
    Thank you!
    Everything is working now. After i deleted the saved game stuff from the app out of google (drive.google.com), i have no problems. Sorry for wasting your time!
     
  39. RakshithAnand

    RakshithAnand

    Joined:
    Jun 30, 2013
    Posts:
    56
    Hi,

    I am implementing Google RealTime Multiplayer for my game and now just started with basic invitation listening and sending.
    When I invite the a player, he is not getting the "ActionInvitationRecieved" event. What might be the issue?

    After sign in to google play, I do register to invitation listener as shown in example.

    This happens even in asset's example scene. I invite a player and his invitation is seen outside in google play games but inside the game there is no event triggered.
    Please help.. this is very important.

    Thanks
     
    Last edited: Sep 15, 2016
  40. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Hello,
    Additional detailed information required to find out the reason for such behavior.
    So, please, capture the LogCat logs from both devices you are testing for Real-Time Multiplayer.
    Add Unity and AndroidNative filters for the log and save the full log as well.

    Such kind of functionality as the Real-Time Multiplayer is are much time-consuming for finding out any kind of issues no matter it's your mistake in implementation or some kind of issue on the plugin side.
    My recommendation for you is to contact the support team with this case because it's much harder to solve this case in a forum circumstances.
     
  41. RakshithAnand

    RakshithAnand

    Joined:
    Jun 30, 2013
    Posts:
    56
    Hi
    I have a doubt.

    In google play RTM,
    GooglePlayRTM.Instance.SendDataToAll() method sends data to the player who is sending it as well or only other players in the room?

    Thanks
     
  42. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Hello,
    SendDataToAll should send the message to other participants excluding the current player.
     
  43. RakshithAnand

    RakshithAnand

    Joined:
    Jun 30, 2013
    Posts:
    56
    Thanks you! Initially was of the impression that it sends to all the players including current player. Got to know after debugging.
     
  44. Outerminds

    Outerminds

    Joined:
    Mar 29, 2014
    Posts:
    2
    Hi,

    I have a crash on android when I call the function:
    PermissionsManager.Instance.RequestPermissions(AN_ManifestPermission.GET_ACCOUNTS);

    Here are the logs:
    09-20 17:07:03.959: W/System.err(9744): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.outerminds.tubular/com.androidnative.AndroidNativeProxy}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
    09-20 17:07:03.959: W/System.err(9744): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
    09-20 17:07:03.959: W/System.err(9744): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
    09-20 17:07:03.959: W/System.err(9744): at android.app.ActivityThread.access$900(ActivityThread.java:150)
    09-20 17:07:03.959: W/System.err(9744): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
    09-20 17:07:03.959: W/System.err(9744): at android.os.Handler.dispatchMessage(Handler.java:102)
    09-20 17:07:03.959: W/System.err(9744): at android.os.Looper.loop(Looper.java:148)
    09-20 17:07:03.959: W/System.err(9744): at android.app.ActivityThread.main(ActivityThread.java:5417)
    09-20 17:07:03.959: W/System.err(9744): at java.lang.reflect.Method.invoke(Native Method)
    09-20 17:07:03.959: W/System.err(9744): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:764)
    09-20 17:07:03.959: W/System.err(9744): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
    09-20 17:07:03.959: W/System.err(9744): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
    09-20 17:07:03.959: W/System.err(9744): at com.androidnative.AndroidNativeProxy.onStart(AndroidNativeProxy.java:38)
    09-20 17:07:03.959: W/System.err(9744): at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1238)
    09-20 17:07:03.959: W/System.err(9744): at android.app.Activity.performStart(Activity.java:6302)
    09-20 17:07:03.959: W/System.err(9744): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
    09-20 17:07:03.959: W/System.err(9744): ... 9 more

    It even crashes when I try it in the test scene "PermissionsAPIExample". Do you have a clue how I could fix this?

    Testing on Android 6.0.1, using Unity 5.4.0p2.

    Thank you!
     
  45. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Hello,
    This issue has already been fixed.
    Please, contact the support team and you will be provided with the instructions how to fix it.
    The official fix will be available with following update during this week.
     
  46. RakshithAnand

    RakshithAnand

    Joined:
    Jun 30, 2013
    Posts:
    56
    Hi again,

    How do I disable your plugins Debug messages?
    Im asking because when Im sending many messages during RTM , on a slower phone it causes lag spikes.
    Is there a way to disable it for a normal build?

    Thanks
     
  47. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Do you mean the messages with Unity tag?
    Unfortunately, there is no such possibility to disable all the log output.
    If you are facing too much log messages with Unity tag, please, remove it manually from the scripts.
     
  48. RakshithAnand

    RakshithAnand

    Joined:
    Jun 30, 2013
    Posts:
    56
    Yes,
    The Debug.Log() in scripts such as "GooglePlayRTM.cs"

    Hmm alright. A suggestion though. Future update try to make your own lets say a script containing your Debug Log function and provide a Check mark in Native Android/ios Settings to bypass your debug log method. Because a lot of Messages are logged even in the final build especially when using Real Time Multiplayer.

    Please consider it. Thanks!
     
  49. Outerminds

    Outerminds

    Joined:
    Mar 29, 2014
    Posts:
    2
    Thanks, will do!
     
  50. BenoitFreslon

    BenoitFreslon

    Joined:
    Jan 16, 2013
    Posts:
    166
    Hello I'm using the version 9.0 of the AndroiNative plugin.

    When I add new permissions with the Manifest Manager in the editor the new permissions are removed.
    I also uncheck the function: Keep Android Manifest Clean

    Any Help?

    SOLVED: Indeed the "SAVE MANIFEST" button is on the "Manifest" tab.
     
    Last edited: Sep 29, 2016