Search Unity

[Released] Android Native Plugin

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

  1. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    there is one more thing. It should check if the app is installed or not, if installed then launch and if not installed then download from specific URL (local or web based) and then launch. If in case some notifications are required for installation then do not mind to have them.
    thanks for your help.I will buy the plugin once it has above mentioned feature.
     
  2. cipu

    cipu

    Joined:
    Mar 27, 2013
    Posts:
    10
    Hello Lacost i wonder this plugin is can support leaderboard for IOS.
     
  3. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Hi Stan,

    There is an issue between Android Native and iOS Native with the preloader in Playmaker action.

    If I add the preloaded in android AND iOS in the same action, I build it on android, the preloader is never ender (even if I czall hide preloaded).


    And it works if I turn off the preloader of iOS.

    Thanks.
     
  4. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Hi guys I have a little problem with Google Play Service :( ...after I'm hitting Connect the GooglePlay popUp appears ...I'm signing in after that simply I'm disconnected :

    Please...any suggestions on what could causing this ? :(
     
  5. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Also good feature request :) Both feature will be available in v4.7


    If you mean google play for IOS, then no. I tried develop such plugin but it wasn't really popular to use google play on IOS. Everybody want's game center :)
    Have a look on this products:
    IOS Native - leaderboard for IOS
    Ultimate Mobile - cross platform solutions


    Thanks for report. I will truly appreciate if you will send description how to recreate this issue to the stans.assets@gmail.com


    It means your set up isn't correct.
    So here is what I am suggesting for you:
    1) Please check one more time the Play Service Set up Guide:
    2) If you will have the same issue please send your log cat log to the support team at stans.assets@gmail.com

    Cheers!
     
  6. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Hi,

    there is a conflict between Android Native and Google Native.

    If I install google native first,I just can't install Android Native.

    When I install (completely, following you tuto) Android Native first, and after Google Native, I have this message.

    ..
     

    Attached Files:

    • _a.png
      _a.png
      File size:
      82.1 KB
      Views:
      940
  7. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    WOW!
    Any expected date for version 4.7?
    It will be great news for the day. I wish I get may hands on it soon.
    Going to buy it as soon as you confirm it is all in.
     
  8. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    "Ultimate Mobile - cross platform solutions" I bought all you asset. And it's pretty complicated to import one by one them at each update or each new project.

    Is it possible, if I send to you all my "Purchase Confirmation" from Unity to have a coupon for this asset ?

    Thanks.
     
  9. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Well I am submitting updates every 2 weeks, The 4.6 was just submitted on last weekend, 4.7 will be in 10 days. You can send me and e-mail so I will send you beta version as soon as it will be ready.


    I would love to do that. I will check this with Asset Store team. Send me e-mail please, with the same request.
    It's really hard to remember all forum post, when important email always there for me.

    And guys pleas use my personal mail this time. Contacts can be found here:
    https://www.assetstore.unity3d.com/en/#!/publisher/2256
    Cheers!
     
  10. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    Send email for beta?
    Need to buy before that?
     
  11. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Yep, I just can't keep track of all forum posts, so e-mail much more convent for me.

    You can by after you will be happy with product, and I am sure you will :)
     
  12. Stans-Assets

    Stans-Assets

    Joined:
    Jun 20, 2014
    Posts:
    57
    AndroidNative v 4.5 just released.



    Updates:
    • Documentations updated
    • New Play Maker Actions added
    • Native Pop ups now can be dismissed by back button
    • AndroidNotificationManager API changed
    • ScheduleLocalNotification(string title, string message, int seconds) to ScheduleLocalNotification(string title, string message, int seconds, int id)
    • CanselLocalNotification(string title, string message) to CanselLocalNotification(int id)

    New Features:
    GooglePlayManager:

    • currentAccount getter added
    • ResetAllAchievements() method added
    • UpdatePlayerScore(leaderboardId, span, collection) method added
    • SCORE_UPDATED event added

    AndroidSocialGate:
    • Now if external storage not available - Local app Cache + FileProvider will be used to share images.

    AddressBookController:
    • Action OnContactsLoadedAction added

    Minor Settings Editor Improvements

    Fixes:
    • Adding FB default Scopes fixed
    • resetAchievement fixed
    • resetLeaderBoard fixed

    Refactor:
    • GooglePlayManager.SCORE_REQUEST_RECEIVED -> GooglePlayManager.SCORE_UPDATED
     
  13. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Hi,

    Is it possible to have a method + Playmaker action for a local notification ? (like in iOS Native plugin) ?


    Thanks !
     
  14. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Hi,

    I have this error when I installed Android Native + Mobile social plugin :


    FormatException: Unknown char: U
    System.Double.Parse (System.String s, NumberStyles style, IFormatProvider provider) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Double.cs:209)
    System.Single.Parse (System.String s) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Single.cs:183)
    System.Convert.ToSingle (System.String value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Convert.cs:1696)
    AndroidNativeSettingsEditor.get_Version () (at Assets/Extensions/AndroidNative/Editor/AndroidNativeSettingsEditor.cs:81)
    AndroidNativeSettingsEditor.GeneralOptions () (at Assets/Extensions/AndroidNative/Editor/AndroidNativeSettingsEditor.cs:123)
    AndroidNativeSettingsEditor.OnInspectorGUI () (at Assets/Extensions/AndroidNative/Editor/AndroidNativeSettingsEditor.cs:33)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty)
    UnityEditor.DockArea:OnGUI()




    And I have too the message, in the AndroidNativeSettings : Update required, ressources version : Unknown Plugn version : 4.5 (??!!!!! it's the last one!).





    And last, but not least : when I installed Android Native, and after, Mobile Social Plugin I have a pop up who ask me to remplace the actual android manifest (who was from your first plugin) by a new, or to ignore the message.

    And I have again this pop up when I installed Google Mobile Ad (from you).


    I lose a thousand of hours to delete all the plugins from my projects, and reinstall them.

    Sometimes it works, sometimes not.


    I don't know what to do.


    Thank you in advance for your help.


    Best regards.
     
  15. jarga

    jarga

    Joined:
    Jul 23, 2014
    Posts:
    4
    Hello,

    It is a nice plugin, I used it for my in-app products.

    I am now doing some billing test, I have purchased an item but I don't know how to reset. I need to reset to do more test.

    I have canceled the order in google wallet console and it showed ORDER STATUS Canceled, DELIVERY STATUS Will not deliver , but when I call AndroidInAppPurchaseManager.instance.inventory.IsProductPurchased(xxx) It still returns true.

    Do you know how to do it?

    Thankyou
     
  16. Nezard

    Nezard

    Joined:
    Apr 14, 2013
    Posts:
    12
    Hi, Stan.

    How can I get a rank of public leaderboard by score?

    According to AndroidNative document, there is a class 'LeaderBoardScoreVariant' which can get rank. However, it doesn't exist.
     
    Last edited: Sep 17, 2014
  17. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    Do you have a plugin for AMAZON IAP's? I have your iOS and Android native plugins, hoping you have a way to purchase IAP's on Amazon.

    Gigi
     
  18. BitDemon-Games

    BitDemon-Games

    Joined:
    Jan 27, 2013
    Posts:
    9
  19. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Hi,

    Is it possible to program remote local notifications ?

    Thanks !
     
  20. liory

    liory

    Joined:
    Feb 13, 2013
    Posts:
    3
    I think your plugin is not installed correctly (I had the same problem).

    If you get this error it's because you have this file missing:
    "Plugins/StansAssets/Versions/AN_VersionInfo.txt"
    You can just create the file and write 4.5 inside to make the error disappear.

    But I think the best way to solve this is:
    1) Delete the files: Plugin/Android/androidnative.jar
    2) Open Window/Android Native/ Edit settings
    3) Push the install button

    Btw this error happen 100% of the time if you install the Mobile social Plugin before this plugin. Because both plugin check if(androidNative.jar) to see if the plugin is installed of not.
     
    Last edited: Sep 19, 2014
  21. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Hi Stanislav, I'm very new with Unity and obviously with ANP I have some questions:
    1. It's possible to make one time connect with facebook and google+ ?
    2. Why the GooglePlay Leaderboard and submitting score doesn't work ?
    3. I'm trying to build social buttons based on your examples using new Unity 4.6 UI and I got some problems, the code:
    Code (CSharp):
    1.  
    2. ////////////////////////////////////////////////////////////////////////////////
    3. //  
    4. // @module Android Native Plugin for Unity3D
    5. // @author Osipov Stanislav (Stan's Assets)
    6. // @support stans.assets@gmail.com
    7. //
    8. ////////////////////////////////////////////////////////////////////////////////
    9. using UnityEngine;
    10. using System.Collections;
    11. using UnityEngine.UI;
    12.  
    13. public class ScreenshotsShare : MonoBehaviour {
    14.    
    15.    
    16.     public SA_Label playerName;
    17.     public SA_Texture playerAvatar;
    18.     public Text ScoreText;
    19.     private int score;
    20.  
    21.  
    22.  
    23.     void Awake(){
    24.         SPFacebook.instance.Init();
    25.         score = PlayerPrefs.GetInt("Score");
    26.         }
    27.  
    28.  
    29.     void Update() {
    30.         scoreText.text = "Score: " + score.ToString();
    31.         }
    32.  
    33.  
    34.  
    35.     void FixedUpdate() {
    36.             if (SPFacebook.instance.userInfo.GetProfileImage(FacebookProfileImageSize.square) != null) {
    37.                 playerAvatar.texture = SPFacebook.instance.userInfo.GetProfileImage(FacebookProfileImageSize.square);
    38.                 playerName.text = SPFacebook.instance.userInfo.name;
    39.                 }
    40.         }
    41.    
    42.     public void Connect(){
    43.             SPFacebook.instance.Login("email,publish_actions");
    44.             SPFacebook.instance.LoadUserData();
    45.             Debug.Log("Connected to FB!");
    46.             }
    47.  
    48.     private void OnUserDataLoaded() {
    49.         SPFacebook.instance.userInfo.LoadProfileImage(FacebookProfileImageSize.square);
    50.     }
    51.  
    52. }
    53.  
    Can you please provide me some suggestion....thanks in advance !
     
  22. rc183

    rc183

    Joined:
    Sep 6, 2013
    Posts:
    3
    Hi Stanislav,

    I have a question regarding the Google Play Game Services connection.

    I have 2 google accounts on my device.


    I have implemented it in my game and at the start of the game, if I'm not already connected with GooglePlay Game Services (I check GooglePlayConnection.state == GPConnectionState.STATE_CONNECTED), I call the function : GooglePlayConnection.instance.connect().

    The issue is I have the Google connection popup that appears to choose the Google account to connect. There is no way to avoid this and just ask the account the first time ? (not for each user conection)

    Thank you
     
  23. Deleted User

    Deleted User

    Guest

    I have problem with AndroidInAppPurchaseManager. In my game I have 4 products: 3 unamanged and one managed.
    When I buy unmanaged product and call consume method on AndroidInAppPurchaseManager I got result 1008 unknown error. Any help?
     
  24. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    Stan? You've been quiet the last week. Hoping you have an Amazon store solution.
    Gigi
     
  25. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hello, sorry for being quiet for a few days. I haven't got new message notification for this thread for some reason
    There is new API for notifications in v4.6, I will add Playmaker actions as well.
    Is your installation problem is not yet solved?
    Guys if you urgent problem send e-mail to stans.assets@gmail.com the support team provide you with answers much faster.


    Under the v3 Android billing API (with is latet and AN use this API) all producs are managed, with mean oyu can simply consume any product using
    Code (CSharp):
    1. AndroindInAppManager.instance.consume(string SKU)
    method.


    Hey, not sure what you mean, but there is CustomLeaderboardGUI example scene. You can just test it, and go over the implementation.


    It's 99% done, it suppose to be submitted on last weekends, but turns out we have to work more on manifest generation utility. It will be submitted for sure on this week
     
    Gigiwoo likes this.
  26. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Just added to the TODO list, it will be implemented in new plugin version

    Sure, here is the guide:

    Thanks a lot for the report I will defiantly check this.
     
  27. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Just added to the TODO list, it will be implemented in new plugin version

    Sure, here is the guide:
    Ad, google drive ins currently unreachable, but just go to the documentation and navigate to push/local notifications block

    Thanks a lot for the report I will defiantly check this.
     
  28. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Code (CSharp):
    1.  SPFacebook.instance.Login("email,publish_actions");
    2.             SPFacebook.instance.LoadUserData();
    You can not request LoadUserData right after you call Login, you need to wait until user will be logged in.


    if you wan't disconnected (or app was reinstalled ) in pervious session, user will be connected automatically,


    Well results, are coming form Google server, plugin is only delivers API calls. But there is no unamanged and managed products anymore, with billing v3 app products are managed.
    If you will provide me (better by e-mail) with your device log, I will able to tell more about your issue.

    Cheers!
     
  29. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Code (CSharp):
    1.  SPFacebook.instance.Login("email,publish_actions");
    2.             SPFacebook.instance.LoadUserData();
    You can not request LoadUserData right after you call Login, you need to wait until user will be logged in.


    if you wan't disconnected (or app was reinstalled ) in pervious session, user will be connected automatically,


    Well results, are coming form Google server, plugin is only delivers API calls. But there is no unamanged and managed products anymore, with billing v3 app products are managed.
    If you will provide me (better by e-mail) with your device log, I will able to tell more about your issue.

    Cheers!
     
  30. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Code (CSharp):
    1.  SPFacebook.instance.Login("email,publish_actions");
    2.             SPFacebook.instance.LoadUserData();
    You can not request LoadUserData right after you call Login, you need to wait until user will be logged in.


    if you wan't disconnected (or app was reinstalled ) in pervious session, user will be connected automatically,


    Well results, are coming form Google server, plugin is only delivers API calls. But there is no unamanged and managed products anymore, with billing v3 app products are managed.
    If you will provide me (better by e-mail) with your device log, I will able to tell more about your issue.

    Cheers!
     
  31. Makhkk

    Makhkk

    Joined:
    Sep 23, 2014
    Posts:
    3
    Every time I exit the google play leaderboard or achievement this is a page refresh, like a brief "black flash". How can I fix this?
     
  32. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    Fantastic! Will keep my eyes open.
    Gigi
     
  33. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    The problem is between Unity and Google SDK, I am on it with unity support team.
     
  34. Stans-Assets

    Stans-Assets

    Joined:
    Jun 20, 2014
    Posts:
    57
    AndroidNative v 4.6 just released.



    New Features:
    • Build Post Processing added
    • AndroidNativeUtility.instance.RunPackage(string packageName);
    • AndroidNativeUtility.instance.CheckIsPackageInstalled(string packageName);
    • SPFacebook C# Actions Added
    • AndroidTwitterManager C# Actions Added
    • Google Play Leaderboards not accept and return long instead int

    Saving To Gallery:
    • You now can specify gallery folder for your game
    • SaveImageToGalalry - image name param added
    • SaveScreenshotToGallery - image name param added
    • OnImageSaved Event / Action added + you can retrieve image Url

    Local Notifications:
    • Notifications Id Factory added
    • Ability To cancel all notifications
    • Ability to get pending notifications list
    • Now you can find out notification id, which was used to launch the app

    New PlayMaker Actions:
    • AN_RunAp

    Fixes:
    • Gallery Refresh After Photo added fixes
     
  35. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    any change in 4.6 with manifest i just must add identifier
    <category android:name="com.unionassets.android.plugin.preview" />
    in ligne 71 right ?
     
  36. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Thanks for pointing this.
    Please replace
    Code (CSharp):
    1. <category android:name="%APP_BUNDLE_ID%" />
    it like this:

    Android Native Post proses compilation will but your product bundle id there.
    Cheers!
     
  37. ultranol

    ultranol

    Joined:
    Apr 1, 2014
    Posts:
    10
    Hi,

    Would you be able to create an example scene for Playmaker for the Google Play Gifts?

    It's not clear how to use it.

    Or even a guide like you made for the iOS IAP flow - which was great - would be really helpful.

    Thanks.
     
  38. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Sure I will put it to my todo list.
    Cheers!
     
    ultranol likes this.
  39. LeonardK

    LeonardK

    Joined:
    Mar 13, 2013
    Posts:
    10
    Hello,
    When I call AdmobAd.Instance().LoadInterstitialAd() my app is crashing with error:
    09-29 18:18:51.988: ERROR/AndroidRuntime(27728): FATAL EXCEPTION: main
    java.lang.Error: FATAL EXCEPTION [main]
    Unity version : 4.5.2f1
    Device model : samsung GT-I9100
    Device fingerprint: samsung/GT-I9100/GT-I9100:4.0.3/IML74K/XXLPS:user/release-keys
    Caused by: java.lang.NoClassDefFoundError: android/os/AsyncTask
    at android.webkit.WebView.setupPackageListener(WebView.java:1480)
    at android.webkit.WebView.<init>(WebView.java:1300)
    at android.webkit.WebView.<init>(WebView.java:1261)
    at android.webkit.WebView.<init>(WebView.java:1250)
    at android.webkit.WebView.<init>(WebView.java:1218)
    at android.webkit.WebView.<init>(WebView.java:1209)
    at com.google.android.gms.ads.internal.util.g.f(SourceFile:388)
    at com.google.android.gms.ads.internal.util.g.a(SourceFile:375)
    at com.google.android.gms.ads.internal.n.e.a(SourceFile:275)
    at com.google.android.gms.ads.internal.b.<init>(SourceFile:296)
    at com.google.android.gms.ads.internal.b.<init>(SourceFile:277)
    at com.google.android.gms.ads.AdManagerCreatorImpl.a(SourceFile:36)
    at com.google.android.gms.ads.internal.client.o.onTransact(SourceFile:66)
    at android.os.Binder.transact(Binder.java:297)
    at com.google.android.gms.internal.ar$a$a.a(Unknown Source)
    at com.google.android.gms.internal.ah.b(Unknown Source)
    at com.google.android.gms.internal.ah.a(Unknown Source)
    at com.google.android.gms.internal.av.k(Unknown Source)
    at com.google.android.gms.internal.av.a(Unknown Source)
    at com.google.android.gms.ads.InterstitialAd.loadAd(Unknown Source)
    at com.neatplug.u3d.plugins.google.admob.ab.run(Unknown Source)
    at android.os.Handler.handleCallback(Handler.java:605)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4507)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
    at dalvik.system.NativeStart.main(Native Method)

    What can be the cause?

    By the way, it is not crashing on Samsung Galaxy S5, but is crashing on S2
    Works also on Sony Experia Z2.
     
    Last edited: Sep 29, 2014
  40. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hello, well first of all it should look like this:
    Code (CSharp):
    1. AndroidAdMobController.instance.LoadInterstitialAd ();
    Error like Caused by: java.lang.NoClassDefFoundError: android/os/AsyncTask appearing when you trying to execute android native code not from UI thread.

    I do not have AdmobAd class in my Android Native Plugin, so please use AndroidAdMobController, is should solve your issue.
    Cheers!
     
  41. Newando

    Newando

    Joined:
    Sep 9, 2013
    Posts:
    16
    I got the same problem.
    Did you solve it ?!
     
  42. Newando

    Newando

    Joined:
    Sep 9, 2013
    Posts:
    16
    This is the logcat

    Code (CSharp):
    1. I/Unity   (30146): Play Serice Connection State -> STATE_CONNECTING
    2. I/Unity   (30146):
    3. I/Unity   (30146): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
    4. I/Unity   (30146):
    5. E/GooglePlayServicesUtil(30146): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
    6. E/GooglePlayServicesUtil(30146): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
    7. E/GooglePlayServicesUtil(30146): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
    8. D/AndroidNative(30146): connect
    9. D/AppStateService( 1517): client connected with version: 5089000
    10. D/AndroidNative(30146): onConnectionFailed
    11. D/AndroidNative(30146): Erro code:4
    12. D/AndroidNative(30146): hasResolution: true

    Any idea ?!
     
  43. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    From the log I see, that Google return error code 4, with mean SIGN_IN_REQUIRED.
    So the question is why your used cant' sing in. In 99% cases it' due to wrong app config. If you will send me full log I will be able to figure out what is missed in your case.
    Cheers!
     
  44. Newando

    Newando

    Joined:
    Sep 9, 2013
    Posts:
    16
    It was a problem on the Google Developer Console. The state of the Play service was turned in "not published" state.
    Cheers.
     
  45. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    I glad you problem is solved, good luck with the project.
    Cheers!
     
  46. MatthewVale

    MatthewVale

    Joined:
    Aug 5, 2014
    Posts:
    7
    Hey, is it possible to get the signed in player's current leaderboard score? For example if the user gets a score of 100, but they reinstall the app and the local score gets reset back to 0, how can I get their leaderboard score so I can assign it to the local score?

    Cheers.
     
  47. jylee656

    jylee656

    Joined:
    Nov 5, 2012
    Posts:
    3
    Hi,

    In your Android Native Plugin4.7 I can't find the Real-Time-Multiplayer Play Service feature anymore.
    And I found that the RTM section has removed from your manual. What is going on?
    You stop support RTM feature?
     
  48. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    It's simple here is the example:
    Code (CSharp):
    1.  
    2.     private void loadLeaderBoards() {
    3.  
    4.         //listening for load event
    5.         GooglePlayManager.instance.addEventListener (GooglePlayManager.LEADERBOARDS_LOEADED, OnLeaderBoardsLoaded);
    6.         GooglePlayManager.instance.loadLeaderBoards ();
    7.         SA_StatusBar.text = "Loading Leader Boards Data...";
    8.     }
    9.  
    10.  
    11. private void OnLeaderBoardsLoaded(CEvent e) {
    12.         GooglePlayManager.instance.removeEventListener (GooglePlayManager.LEADERBOARDS_LOEADED, OnLeaderBoardsLoaded);
    13.  
    14.         GooglePlayResult result = e.data as GooglePlayResult;
    15.         if(result.isSuccess) {
    16.             if( GooglePlayManager.instance.GetLeaderBoard(LEADERBOARD_ID) == null) {
    17.                 AndroidNative.showMessage("Leader boards loaded", LEADERBOARD_ID + " not found in leader boards list");
    18.                 return;
    19.             }
    20.  
    21.  
    22.             SA_StatusBar.text = LEADERBOARD_NAME + "  score  " + GooglePlayManager.instance.GetLeaderBoard(LEADERBOARD_ID).GetCurrentPlayerScore(GPBoardTimeSpan.ALL_TIME, GPCollectionType.GLOBAL).score.ToString();
    23.             AndroidNative.showMessage (LEADERBOARD_NAME + "  score",  GooglePlayManager.instance.GetLeaderBoard(LEADERBOARD_ID).GetCurrentPlayerScore(GPBoardTimeSpan.ALL_TIME, GPCollectionType.GLOBAL).score.ToString());
    24.         } else {
    25.             SA_StatusBar.text = result.message;
    26.             AndroidNative.showMessage ("Leader-Boards Loaded error: ", result.message);
    27.         }
    28.  
    29.         UpdateBoardInfo();
    30.  
    31.     }
     
  49. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Nope, it's there and I am going to add turn based shortly.
    You can find example scene under:
    Assets/Extensions/AndroidNative/xExample/Scenes/PlayService/RTM_Example

    Cheers!
     
  50. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Hi Stanislav, I have 2 questions about googleplay service :
    1. It's fine to give achievements this way:
    Code (CSharp):
    1. void LateUpdate()
    2.     {
    3.         if (enemyKilled >= 500)
    4.         {
    5.             GooglePlayManager.instance.reportAchievement("achievement_untouchable");
    6.         }
    7.     }
    2. I want the player when entering the game ...in my first scene to implement the code for first checking if there is an internet connection, after that to connect to GooglePlay Service....
    Code (CSharp):
    1. void Awake() {
    2. GooglePlayConnection.instance.connect ();
    3. //something like this
    4. }
    What is the best way to achive this ?

    Cheers,