Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Released] Android Native Plugin

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

  1. SirNewton

    SirNewton

    Joined:
    Oct 22, 2013
    Posts:
    9
    Hey Stan,

    I have a small issue with the banner which I don't understand:
    I have a general game object (not being destroyed anytime), which have AndroidAdMobBanner script attached. in it there's one function that call to Show the banner and another function to hide the banner (X.ShowBanner() & X.HideBanner())

    the thing is:
    when the game starts, on the main menu, the show function is called, and it shows the banned.
    once the "play" button is pressed, it hides the banner.
    so far so good.

    when the game ends and returns to the main menu, there's another call to show the banner, but it doesn't show. from a short debug it says (upon the re-entry) isLoaded = true & onScreen = true....

    but it's not on screen :(
     
  2. vambier

    vambier

    Joined:
    Oct 1, 2012
    Posts:
    102
    Hi Stan,

    I have a problem with submitting high scores to Facebook.

    I've added the following to the Awake() function :
    Code (CSharp):
    1. SPFacebook.instance.OnSubmitScoreRequestCompleteAction += OnSubmitScoreRequestComplete;
    2.  
    3. SPFacebook.instance.Init();
    I've got a function that does :

    Code (CSharp):
    1. SPFacebook.instance.SubmitScore(10);
    But the highscore is not being posted. It doesn't even get to the
    Code (CSharp):
    1. OnSubmitScoreRequestComplete
    Callback function.

    I'm logging in with
    Code (CSharp):
    1. SPFacebook.instance.Login("email,publish_actions");
    so that shouldn't be the problem.

    Posting with
    Code (CSharp):
    1. SPFacebook.instance.Post
    does work so it has nothing to do with the connection between the game and Facebook.

    I'm using Unity 4.3 with the latest version of the Android Native Plugin.

    Can you help me with this problem?

    Thanks!!
     
  3. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    the banner OnOpenedAction means that the banner is opened to the full screen after somebody clicked it. If you what to find out when banner content is loaded, use: OnLoadedAction
    Code (CSharp):
    1. string text = "ggyy";
    2.  
    3. void OnGUI()
    4. {
    5. GUI.Label(new Rect(10, 10, 500, 100), text);
    6. }
    7.  
    8. private void CreateBannerCustomPos()
    9. {
    10. banner1 = AndroidAdMobController.instance.CreateAdBanner(300, 100, GADBannerSize.BANNER);
    11. banner1.OnOpenedAction += BO;
    12. }
    13.  
    14. void BO(GoogleMobileAdBanner banner)
    15. {
    16. banner.OnOpenedAction -= BO;
    17. text = "BANNER_AD_OPENED";
    18. }


    i need playmaker actions for this[/QUOTE]
    Sorry, what do you mean by startapp integration?



    Hello, thanks a lot for the report, issue detected and fixed, The updated 5.1 version will be available tomorrow.
    Cheers!
     
  4. TheOz

    TheOz

    Joined:
    May 21, 2011
    Posts:
    34
    Hello Stan, I am having trouble integrating android native into my unity game. I have setup multiple times trying to get this to work. rebuilt client ids and authorized the app for testing and get the same issue. at startup I get a STATE_CONNECTING MESSAGE, then a STATE_DISCONNECTED, then and INTERNAL_ERROR

    Here is the logcat:
    D/Unity ( 8361): Releasing Unity-StartupWakeLock
    D/Unity ( 8361): Sensor : Accelerometer ( 1) ; 0.038344 / 0.01s ; MPL Accelerometer / Invensense
    D/Unity ( 8361): SendMessage: object AndroidApp not found!
    I/Unity ( 8361): setScreenSize: -1x-1 (720x1184 / 720x1184)
    I/Unity ( 8361): setScreenSize: keeping layout size 720x1184
    D/Unity ( 8361): UnloadTime: 1.587000 ms
    D/Unity ( 8361): UUID: 99000028618884 => 7351e04b6f37847e9ed9ee0e93412dd8
    D/Unity ( 8361): Platform assembly: /data/app/com.swordandshieldstudio.facepop-2.apk/assets/bin/Data/Managed/System.dll (this message is harmless)
    I/Unity ( 8361): GooglePlayRTM Created
    I/Unity ( 8361): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity ( 8361): UnityEngine.Debug:Log(Object)
    I/Unity ( 8361): GooglePlayRTM:Awake() (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayRTM.cs:91)
    I/Unity ( 8361): UnityEngine.GameObject:Internal_AddComponentWithType(Type)
    I/Unity ( 8361): UnityEngine.GameObject:AddComponent(Type)
    I/Unity ( 8361): UnityEngine.GameObject:AddComponent()
    I/Unity ( 8361): SA_Singleton`1:get_instance() (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/GooglePlayCommon/PUtil/SA_Singleton.cs:33)
    I/Unity ( 8361): BoardController:Awake() (at /Users/garryosborne/FlipIts110814_01/Assets/Scripts/BoardController.cs:373)
    I/Unity ( 8361):
    I/Unity ( 8361): (Filename: /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayRTM.cs Line: 91)
    I/Unity ( 8361):
    I/Unity ( 8361): Play Serice Connection State -> STATE_CONNECTING
    I/Unity ( 8361): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity ( 8361): UnityEngine.Debug:Log(Object)
    I/Unity ( 8361): GooglePlayConnection:OnStateChange(GPConnectionState) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:201)
    I/Unity ( 8361): GooglePlayConnection:connect(String) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:84)
    I/Unity ( 8361): GooglePlayConnection:connect() (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:75)
    I/Unity ( 8361): BoardController:Awake() (at /Users/garryosborne/FlipIts110814_01/Assets/Scripts/BoardController.cs:376)
    I/Unity ( 8361):
    I/Unity ( 8361): (Filename: /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs Line: 201)
    I/Unity ( 8361):
    I/Unity ( 8361): GooglePlayManager was created
    I/Unity ( 8361): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity ( 8361): UnityEngine.Debug:Log(Object)
    I/Unity ( 8361): GooglePlayManager:Create() (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayManager.cs:88)
    I/Unity ( 8361): GooglePlayConnection:connect(String) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:86)
    I/Unity ( 8361): GooglePlayConnection:connect() (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:75)
    I/Unity ( 8361): BoardController:Awake() (at /Users/garryosborne/FlipIts110814_01/Assets/Scripts/BoardController.cs:376)
    I/Unity ( 8361):
    I/Unity ( 8361): (Filename: /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayManager.cs Line: 88)
    I/Unity ( 8361):
    D/Unity ( 8361): Unloading 4 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    I/Unity ( 8361): AN: Using proxy for class: com.androidnative.gms.core.GameClientBridge method:playServiceInit
    I/Unity ( 8361): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity ( 8361): UnityEngine.Debug:Log(Object)
    I/Unity ( 8361): AN_ProxyPool:CallStatic(String, String, Object[]) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/GooglePlayCommon/Core/AN_ProxyPool.cs:20)
    I/Unity ( 8361): AN_GMSGeneralProxy:CallActivityFunction(String, Object[]) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/GooglePlayCommon/Core/APIBridge/AN_GMSGeneralProxy.cs:9)
    I/Unity ( 8361): AN_GMSGeneralProxy:playServiceInit(String) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/GooglePlayCommon/Core/APIBridge/AN_GMSGeneralProxy.cs:26)
    I/Unity ( 8361): GooglePlayConnection:init() (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:69)
    I/Unity ( 8361): GooglePlayConnection:connect(String) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:87)
    I/Unity ( 8361): GooglePlayConnection:connect() (at /Users/garryosborne/
    I/Unity ( 8361): AN: Using proxy for class: com.androidnative.gms.core.GameClientBridge method:playServiceConnect
    I/Unity ( 8361): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity ( 8361): UnityEngine.Debug:Log(Object)
    I/Unity ( 8361): AN_ProxyPool:CallStatic(String, String, Object[]) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/GooglePlayCommon/Core/AN_ProxyPool.cs:20)
    I/Unity ( 8361): AN_GMSGeneralProxy:CallActivityFunction(String, Object[]) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/GooglePlayCommon/Core/APIBridge/AN_GMSGeneralProxy.cs:9)
    I/Unity ( 8361): AN_GMSGeneralProxy:playServiceConnect() (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/GooglePlayCommon/Core/APIBridge/AN_GMSGeneralProxy.cs:30)
    I/Unity ( 8361): GooglePlayConnection:connect(String) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:93)
    I/Unity ( 8361): GooglePlayConnection:connect() (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:75)
    I/Unity ( 8361): BoardController:Awake() (at /Users/garryosborne/Flip
    D/Unity ( 8361): System memory in use before: 7.2 MB.
    D/Unity ( 8361): Unloading 0 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    D/Unity ( 8361): System memory in use after: 7.3 MB.
    D/Unity ( 8361):
    D/Unity ( 8361): Unloading 5 unused Assets to reduce memory usage. Loaded Objects now: 2843.
    D/Unity ( 8361): Total: 22.125000 ms (FindLiveObjects: 1.037000 ms CreateObjectMapping: 0.458000 ms MarkObjects: 19.501001 ms DeleteObjects: 0.915000 ms)
    D/Unity ( 8361):
    I/Unity ( 8361): -----> OnPlayerDisconnected
    I/Unity ( 8361): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity ( 8361): UnityEngine.Debug:Log(Object)
    I/Unity ( 8361): BoardController:OnPlayerDisconnected() (at /Users/garryosborne/FlipIts110814_01/Assets/Scripts/BoardController.cs:759)
    I/Unity ( 8361): UnionAssets.FLE.EventDispatcher:dispatch(Int32, Object, String) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/FlashLikeEvents/Events/Core/Events/EventDispatcher.cs:191)
    I/Unity ( 8361): UnionAssets.FLE.EventDispatcher:dispatch(String) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/FlashLikeEvents/Events/Core/Events/EventDispatcher.cs:147)
    I/Unity ( 8361): GooglePlayConnection:OnStateChange(GPConnectionState) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:194)
    I/Unity ( 8361): GooglePlayConnection:OnConnectionResult(String) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:174)
    I/Unity ( 8361):
    I/Unity ( 8361): (Filename: /Users/garryosborne/FlipIts110814_01/Assets/Scripts/BoardController.cs Line: 759)
    I/Unity ( 8361):
    I/Unity ( 8361): Play Serice Connection State -> STATE_DISCONNECTED
    I/Unity ( 8361): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity ( 8361): UnityEngine.Debug:Log(Object)
    I/Unity ( 8361): GooglePlayConnection:OnStateChange(GPConnectionState) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:201)
    I/Unity ( 8361): GooglePlayConnection:OnConnectionResult(String) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:174)
    I/Unity ( 8361):
    I/Unity ( 8361): (Filename: /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs Line: 201)
    I/Unity ( 8361):
    I/Unity ( 8361): ----->Connection failed with code: INTERNAL_ERROR
    I/Unity ( 8361): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity ( 8361): UnityEngine.Debug:Log(Object)
    I/Unity ( 8361): BoardController:ActionConnectionResultReceived(GooglePlayConnectionResult) (at /Users/garryosborne/FlipIts110814_01/Assets/Scripts/BoardController.cs:4298)
    I/Unity ( 8361): GooglePlayConnection:OnConnectionResult(String) (at /Users/garryosborne/FlipIts110814_01/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:178)
    I/Unity ( 8361):
    I/Unity ( 8361): (Filename: /Users/garryosborne/FlipIts110814_01/Assets/Scripts/BoardController.cs Line: 4298)
    I/Unity ( 8361):
    I/Unity ( 8361): onPause
    I/Unity ( 8361): ---------->>>>>>>>>> awardAndroidAchievements: connect state = STATE_DISCONNECTED mscore = 0
    I/Unity ( 8361): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity ( 8361): UnityEngine.Debug:Log(Object)
    I/Unity ( 8361): BoardController:awardAndroidAchievements() (at /Users/garryosborne/FlipIts110814_01/Assets/Scripts/BoardController.cs:1167)
    I/Unity ( 8361): BoardController:OnApplicationPause(Boolean) (at /Users/garryosborne/FlipIts110814_01/Assets/Scripts/BoardController.cs:4220)
    I/Unity ( 8361):
    I/Unity ( 8361): (Filename: /Users/garryosborne/FlipIts110814_01/Assets/Scripts/BoardController.cs Line: 1167)
    I/Unity ( 8361):
    D/Unity ( 8361): Sensor : Accelerometer ( 1) ; 0.038344 / 0.01s ; MPL Accelerometer / Invensense
    I/Unity ( 8361): windowFocusChanged: false
    D/Unity ( 8361): [EGL] Attaching window 0x0

    I am lost as to what to try next, Any advice?
    I am testing on a galaxy nexus
     
  5. vambier

    vambier

    Joined:
    Oct 1, 2012
    Posts:
    102

    Hi Stan,

    Any thoughts on this?
     
  6. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hey, TheOz, This can happen when you haven't set the signature for the client ID in your API console project, or if you copied the wrong key value from keytool. Doing so is documented in the steps of the quick start guide on steps 7, 8, 9, and 10.

    Hey, vambier. Well, you missing the permission scope.

    You also need user_games_activity, friends_games_activity


    Here is the full guide:
    https://unionassets.com/mobile-social-plugin/scores-api-137

    Cheers!
     
  7. srenshaw

    srenshaw

    Joined:
    Feb 12, 2014
    Posts:
    14
    I've just updated to 5.1 and it seems the Playmaker actions were not updated to reflect the new naming conventions. I've amended each of the actions that were highlighted in the log as deprecated but I'm left with the following error:

    Assets/Extensions/AndroidNative/Addons/AndroidNativeActions/PlayService/AN_ReportAchievement.cs(15,52): error CS1061: Type `GooglePlayManager' does not contain a definition for `unlockAchievementById' and no extension method `unlockAchievementById' of type `GooglePlayManager' could be found (are you missing a using directive or an assembly reference?)
     
  8. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    hello lacost
    i own android native, i notice it has google analytic, does it work for iOS as well?

    thanks
     
  9. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    My bad, I will submit playmaker actions update tomorrow. Thanks a lot for the report.


    Hello. not it working for android. If you need cross-platform analytics solution, have a look:
    https://www.assetstore.unity3d.com/en/#!/content/16317

    Cheers!
     
  10. MatthewVale

    MatthewVale

    Joined:
    Aug 5, 2014
    Posts:
    7
    Hi,

    I think I'm missing something here. The last 2 games I uploaded to Google Play have Achievements and a leaderboard and they don't work properly. On one app I can sign in, but when I load achievementsUI, it shows the loading icon and then disappears. For my latest game that I uploaded today, I can't even sign in. I used very similar code to another game that DOES work. So I don't think my code is the issue. The strange thing is, achievements and leaderboard work perfectly when beta testing! But don't seem to work when I publish them. My ids are fine, the OAUTH2 seems fine. The plugin is the latest version.

    Thanks
     
  11. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    If you provide URLs to your games I will be able to download it, and go over the device log to find out what goes wrong.
    Cheers!
     
  12. MatthewVale

    MatthewVale

    Joined:
    Aug 5, 2014
    Posts:
    7
    Thanks, it's been bugging me for a while.

    1. In this one I seem to be able to sign in, but can't view achievements
    https://play.google.com/store/apps/details?id=com.matthewvale.voxelraidersfree
    2. With this one I can't sign in at all
    https://play.google.com/store/apps/details?id=com.matthewvale.circles


    EDIT:
    Problem has now been solved, the problem was I had Anti-Piracy ON in the Game Services settings, preventing me from accessing the services when building to my device.

    All the best!
     
    Last edited: Dec 2, 2014
  13. Stans-Assets

    Stans-Assets

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



    New Features:
    • Immersive mode does not requires main activity anymore
    • Popup now use Holo Android theme
    • App Licensing, read more
    Billing:
    • Purchase method now accept developer payload as additional parameter.
    • Original JSON filed now available with consume Response
    Saved Games:
    • CreateNewSnapshot - PlayedTime param added
    • GP_SnapshotMeta - TotalPlayedTime filed added
    • ActionGameSaved - Action Added
    • Snapshot Saving issue fixed
    Refactor
    • Google Play Manager methods name conventions fixed
    Fixes:
    • Local notification template saving with UTF8 fixed
    • Local notification template loading fixed.
    • Auto reconnect not starting anymore if user has signed out suing external play service UI.
    • AchievementBuffer leak fixed
    • Analytics Start Tracking function fixed
    • Facebook re auth bug fixed
    • Receiving Push Notification when app is closed bug fixed
    • GoogleGender constant values fixed
    Spelling Fixes:
    • Tocken => Token
    • Loeaded => Loaded
    • Achivment => Achievement
    • Retrive => Retrieve
    • Avaliable => Available
    • SpanShot => Snapshot
    • GooglePlaySavedGmaesManager => GooglePlaySavedGamesManager
      Note: please remove old GooglePlaySavedGmaesManager manually
    • NotoficationsExample -> NotificationsExample
      Note: please remove old NotoficationsExample manually
    • GoogleGenger -> GoogleGender
      Note: please remove old GoogleGenger manually
     
  14. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Is it possible to set recurring local notifications with your plugin? I want to send notifications every day at 8:00 13:00 and 19:00. I can't seem to find anything in the documentation about local notifications.

    EDIT:
    So I checked the code of the Local Notifications and it seems to me that the only option in the plugin is settings the delay in seconds for the notification. Wouldn't it be easier if there is a function to add a DateTime object? By the way does this only send out 1 local notification or is it a recurring notification?
     
    Last edited: Dec 2, 2014
    RoyalCoder likes this.
  15. vambier

    vambier

    Joined:
    Oct 1, 2012
    Posts:
    102
    Thanks!! I'll give that a try!!

    I now see I have another problem. I'm also using revmob banners. But after I updated to the latest android native library I no longer see the revmob banners. I also updated to the latest revmob library but it made no difference.
    I know it's not your library but do you know what could be causing this? Maybe some AndroidManifest?
     
  16. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    1) It's scheduling 1 local notification, per method call. But you can schedule as much notifications as you wish,

    I will take this to account, and will try to add this as option with future releases.


    I do not think it's possible. but you can achieve similar behaviour with setting up such notifications each time your app start and clean up old ones.


    It may be due to some kind of conflict. Just go over your device log, and you will get the answer. Feel free to send your device log with the problem description to the support team at stans.assets@gmail.com if you will need help with it.
    Cheers!
     
  17. XCO

    XCO

    Joined:
    Nov 17, 2012
    Posts:
    379
  18. eze_devarg

    eze_devarg

    Joined:
    Jan 21, 2014
    Posts:
    5
    Hello, please I need your help with a problem. I want to connect when you start the game
    I my class is not running, use the connection function ()
    but when I compile the apk on my mobile does not start, it is labeled and closed one.

    this is my code
    this at the start of the program in the first scene.


    using UnityEngine;
    using System.Collections;

    public class conectar : MonoBehaviour {

    // Use this for initialization
    void Start () {

    GooglePlayConnection.ActionConnectionResultReceived += ActionConnectionResultReceived;
    //GooglePlayConnection.instance.disconnect ();
    //ActionConnectionResultReceived(oglePlayConnection.ActionConnectionResultReceived );
    Conncet();
    //GooglePlayConnection.instance.connect();

    }

    // Update is called once per frame
    void Update () {

    }

    private void Conncet() {
    Debug.Log("GooglePlayManager State -> " + GooglePlayConnection.state.ToString());
    if(GooglePlayConnection.state == GPConnectionState.STATE_CONNECTED) {

    GooglePlayConnection.instance.disconnect ();
    } else {

    GooglePlayConnection.instance.connect ();
    }
    }
    private void ActionConnectionResultReceived(GooglePlayConnectionResult result) {

    if(result.IsSuccess) {
    Debug.Log("Connected!");
    } else {
    Debug.Log("Cnnection failed with code: " + result.code.ToString());
    }
     
  19. LoDx

    LoDx

    Joined:
    Feb 13, 2013
    Posts:
    67
    Hi Stan / @lacost ,
    I'm trying to use the Saved Games for my game. But seems to 'stuck' at the login process.

    I'm using your example scene ( SavedGamesExample scene in xExample) ) as template/prefab and put into my game ( currently in beta test). The problem is that whenever I tried "Connect" , it keeps showing "Connecting", and back to disconnect again. I'm unable to save snapshot for the gameplay/progress.

    **I've also turned On/Enable the required API in my developer console. The SavedGames Snapshot function still doesn't work.


    Thanks Stan!
     

    Attached Files:

    Last edited: Dec 4, 2014
  20. srenshaw

    srenshaw

    Joined:
    Feb 12, 2014
    Posts:
    14
    Hi Stan, have the Playmaker actions been submitted yet? I'm stuck until I can downlolad the updated files.

    Thanks.
     
  21. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    I am not sure what you trying to do, so In start:

    I remove your commented lines:
    Code (CSharp):
    1. void Start () {
    2.  
    3. GooglePlayConnection.ActionConnectionResultReceived += ActionConnectionResultReceived;
    4. Conncet();
    5.  
    6.  
    7. }
    So you subscribed to connect result and then call your connect function
    Code (CSharp):
    1. private void Conncet() {
    2. Debug.Log("GooglePlayManager State -> " + GooglePlayConnection.state.ToString());
    3. if(GooglePlayConnection.state == GPConnectionState.STATE_CONNECTED) {
    4.  
    5. GooglePlayConnection.instance.disconnect ();
    6. } else {
    7.  
    8. GooglePlayConnection.instance.connect ();
    9. }
    10. }
    I do not understand why are you disconnecting user if hi is connected. But any way if the connect function does not give you excpected result it means that something wrong with the play service set up.
    1) Make sure you not missing something from the guides
    2) Looks ad device log, you will see play service error wich will help you to understand what exactly is missing
    3) If you need help with this send your device log + problem description to the stans.assets@gmail.com



    I need to see the device log, before I can tell you why connection is failed. You can send your device log + problem description to the support team at stans.assets@gmail.com or contact me directly with the PM message.


    I am working in it. update playmaker action will appear in few hours. Sorry for delay.
     
  22. eze_devarg

    eze_devarg

    Joined:
    Jan 21, 2014
    Posts:
    5
    thanks

    always goes from connecting disconnected.

    this is my new code


    public class comprobar : MonoBehaviour {

    public GUIText nombre;
    // Use this for initialization
    void Start () {

    GooglePlayConnection.ActionConnectionResultReceived += ActionConnectionResultReceived;
    GooglePlayConnection.instance.connect ();



    }

    // Update is called once per frame
    void Update () {
    nombre.text = GooglePlayConnection.state.ToString();
    }


    private void ActionConnectionResultReceived(GooglePlayConnectionResult result) {
    Debug.Log("entra a la funcion");
    if(result.IsSuccess) {
    Debug.Log("Connected!");
    } else {
    Debug.Log("no se conecto");
    Debug.Log("Cnnection failed with code: " + result.code.ToString());
    }

    }
    }
     
  23. alexsan75

    alexsan75

    Joined:
    Feb 6, 2012
    Posts:
    95
    Hi there,
    very cool Asset you made, nice! recently bought it and now I'm trying to implement Google Play services as first (achievements + leaderboard). I'm going to use almost all features of your Asset, except Billing part, meaning that I will need Facebook+Twitter part as well (resp its modules).

    But I get 'Build failure' because of something when compiling my game?
    "Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details. C:\Program Files\Java\jdk1.7.0_01\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/.../adt-bundle-windows-x86_64/sdk\tools" -Dfile.encoding=UTF8 -jar "C:/.../Unity_4/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -"

    any ideas why?

    I imported the latest version of Native Plugin, thought it did imported as Plugins/Android/StansAsset/.., and not directly into Plugins/Adnroid . Guessing, it was intended or due to I'm already using Unibill's billing solution (to avoid overrride)?

    Do I get that Error because of .jar-files doublets or is there some other problem?
    Android Manifest was adapted by your Asset, and I did put my App_Id in there, as well as Achievements ID's in 'ids'.

    I will also try with clean/empty project to test to compile with only Native Asset, but thought I got some general Error ) Appreciate your help!
     
  24. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    eze_devarg, can you just share device log with me?


    This is know issue.
    https://unionassets.com/android-native-plugin/i-am-getting-build-error-106


    Cheers!
     
  25. alexsan75

    alexsan75

    Joined:
    Feb 6, 2012
    Posts:
    95
    Ok, thanks!
    you mean I have to not just install additionally JRE/JDK 32 bit, but also reconfigure my ADT-bundle to work with 32 bit version if this is even possible, or may be install 32 bit ADT just to compile my game from Unity?

    Which way is the correct one?
     
  26. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hey guys, I am going on vacation so will be not available for the next week. If you have any question or technical issues feel free contact support team, they will work at full power)

    But I will able to solve more complicated stuff in a week!
    Cheers!
     
  27. alexsan75

    alexsan75

    Joined:
    Feb 6, 2012
    Posts:
    95
    Which e-mail to use for Support? stans dot assets at gmail dot com ?

    Edited
    ok, after few tests I got it working: had to type in all IDs in the AndroidManifest file; had to work on FBs part App_ID a bit more (register, set up, etc). Only then it worked to compile the APK and deploy it to Android device.

    But now, when I try to launch my App on a device, I get this: "Unfortunately, App has stopped".. any idea what can cause this?

    Edited
    thanks to adb logcat in Eclipse I catch that little bug that caused my App stopped :) It turned out that App_ID for Google play should be left as it is - Native plugin does all job nicely. Now all works fine.
    Awesome Asset!
     
    Last edited: Dec 8, 2014
  28. OxnardMontalvo

    OxnardMontalvo

    Joined:
    Dec 7, 2014
    Posts:
    3
    Hi,

    I have a problem with Facebook plugin. I can't post a screenshot to Facebook. I get Output: "{"error":{"message":"(#200) Permissions error","type":"OAuthException","code":200}}". I have added permission "publish_actions" but it still not working. Сuriously enough post message function is working fine.
    Can you please help me to solve this?

    Thank You.
     
  29. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    Hey @lacost, any news about the multiplayer library integration?

    Thanks in advance :)

    Edit: Nevermind, i just checked the documentation and it seems that you have already implemented the real time library. I must have missed the changelog ;)
     
    Last edited: Dec 8, 2014
  30. FraMarSaMi

    FraMarSaMi

    Joined:
    May 13, 2014
    Posts:
    86
    There is a problem with android Facebook API because with my application, but also with android native application example (on playstore), when you click on connect it show an error page where you read : "Invalid key hash etc etc The key hash does not match any stored hashes. Configure your app key hases at developers.facebook.com/etc etc

    This error appeare only from second connection because at the first connection the app show the facebook permission page and all function works fine but from the second connection appear this error. If from facebook I revoke the app permission it work again for one time
     
    Last edited: Dec 9, 2014
  31. SeriouSerg

    SeriouSerg

    Joined:
    Jan 27, 2013
    Posts:
    49
    Hello!

    Does anyone have problems with performance?
    I just installed the plugin and have 10 fps drop in my project. I'm not using any functionality of the plugin, just installed and build. Any ideas?
     
  32. Alex-3D

    Alex-3D

    Joined:
    May 21, 2013
    Posts:
    79
    Hi,
    Does Android Native Plugin supports In-app Billing v3 ?
    Thanks
     
  33. alexsan75

    alexsan75

    Joined:
    Feb 6, 2012
    Posts:
    95
    Was testing 'PlayServiceExample' scene, worked well to connect and load Leaderboards, but not Achievements UI ?
    I have the latest Native Android asset version.

    Took me few hours to figure out what was wrong here lol
    Turned out that button 'Button_showAchivmentsUI' had wrong Method Name: 'showAchvementsUI' instead of correct one 'showAchievementsUI'. So, nothing was calling, of course.. edited and all works fine now.

    You might want to fix this bug in the Next update or so. Otherwise, one great Asset! keep going :cool:
     
  34. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    hi i am using playmaker to set admob but i was having issue with my setup how to pate admob id ad mob id contain alphabets and integers so i cannot paste admob key in playmaker can you tell me step by step procedure thanks.
     
  35. djoshi

    djoshi

    Joined:
    Mar 28, 2014
    Posts:
    182
    Yes even I face same problem. Also I noticed one more issue When using Laod Interstitial action it actually shows the ad & not wait for show Interstitial action. Also many actions missing "How to Use Comments" so confuse how to use that action. Please polish Playmaker actions.
     
    Last edited: Dec 12, 2014
  36. djoshi

    djoshi

    Joined:
    Mar 28, 2014
    Posts:
    182
    Ok Got it. When you create banner give there ID(Any Int) which you can use in Hide banner or anywhere.
     
  37. MrTiger

    MrTiger

    Joined:
    Jan 9, 2014
    Posts:
    29
    Hi Lacost,
    I try to use the below code for check if i am like to this page or not..but whenever i try i am getting IsLikes = false can you help me how to fix this problem . right now this is in development Mode . i checked this https://unionassets.com/mobile-social-plugin/likes-api-136 it says i need user_likes permission .so is it not working coz of this permission is not yet approved by Facebook ? or any thing i missed in the code plz help me . i am using unity 4.6 ..


    Code (CSharp):
    1. using UnityEngine;
    2. using UnionAssets.FLE;
    3. using System.Collections;
    4. using UnityEngine.UI;
    5.  
    6. public class FaceBookLike : MonoBehaviour
    7. {
    8. private static bool IsAuntificated = false;
    9. private static bool IsUserInfoLoaded = false;
    10. public Text Status;
    11.  
    12. void Awake()
    13. {
    14. SPFacebook.instance.Init();
    15. }
    16.  
    17. public void Connect()
    18. {
    19. if(!IsAuntificated)
    20. {
    21. SPFacebook.instance.Login("email,publish_actions");
    22.  
    23. }
    24. else
    25. {
    26. LogOut();
    27.  
    28. }
    29. }
    30.  
    31. public void LikePage() {
    32. Application.OpenURL("https://www.facebook.com/pages/My-Casual-Game/578153135619004?ref=aymt_homepage_panel");
    33. }
    34.  
    35.  
    36. public void LogOut()
    37. {
    38. IsUserInfoLoaded = false;
    39.  
    40. IsAuntificated = false;
    41.  
    42. SPFacebook.instance.Logout();
    43. }
    44.  
    45.  
    46. private string UNION_ASSETS_PAGE_ID = "578153135619004";
    47. public void CheckLike()
    48. {
    49.  
    50. //checking if current user likes the page
    51.  
    52.  
    53. bool IsLikes = SPFacebook.instance.IsUserLikesPage(SPFacebook.instance.UserId, UNION_ASSETS_PAGE_ID);
    54. if(IsLikes)
    55. {
    56. Status.text ="Current user Likes MyCasualgame";
    57. } else {
    58. //user do not like the page or we han't yet downloaded likes data
    59. //downloading likes for this page
    60. SPFacebook.instance.addEventListener(FacebookEvents.LIKES_LIST_LOADED, OnLikesLoaded);
    61. SPFacebook.instance.LoadLikes(SPFacebook.instance.UserId, UNION_ASSETS_PAGE_ID);
    62.  
    63. }
    64.  
    65. }
    66.  
    67. private void OnLikesLoaded()
    68. {
    69.  
    70.  
    71. //The likes is loaded so now we can find out for sure if user is like our page
    72. bool IsLikes = SPFacebook.instance.IsUserLikesPage(SPFacebook.instance.UserId, UNION_ASSETS_PAGE_ID);
    73. if(IsLikes) {
    74. Status.text ="Current user Likes MyCasualgame";
    75. } else {
    76. Status.text ="Current user does not like MyCasualgame";
    77. }
    78.  
    79. }
    80.  
    81. }
     
  38. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hey everybody, I am back :)

    Well, yo can get the changelog by clicking on version code number in the asset store, or on this page:
    https://unionassets.com/android-native-plugin/versions



    Hello, you need to add user_photos permission as well.


    Thanks for the report will check this!


    Well, plugin can not bee the reason for FPS drop, since it only delegates method calls to the native part, and not running any tasks in the background.
    Have you tried to use profiler to find out FPS drop issue?



    Yep.


    Thanks, you are right! Fixed it.

    djoshi and unitywlp, thanks for the report, I am glad that you figured out how to use AdMob playmaker actions, but I will create more detailed documentation.


    Try to remove "ref=aymt_homepage_panel" from the page link.


    And I would also recommend to load all user likes with the
    Code (CSharp):
    1. SPFacebook.instance.LoadCurrentUserLikes();
    method

    and then go over all user likes to find out why your page id isn't there:
    Code (CSharp):
    1. foreach(FBLikeInfo like in SPFacebook.instance.GerUserLikesList(SPFacebook.instance.UserId)) {
    2.     Debug.Log("Current user likes: " + like.name);
    3. }
    Each like is represented as FBLikeInfo class instance and contains following info:

    Code (CSharp):
    1. public string id;
    2. public string name;
    3. public string category;
     
  39. MrTiger

    MrTiger

    Joined:
    Jan 9, 2014
    Posts:
    29
    Thx Lacost i will try and let you know :)
     
  40. arvzg

    arvzg

    Joined:
    Jun 28, 2009
    Posts:
    619
    Hi guys,

    I am trying to integrate AdMob into my game using this plugin. I've come to this page explaining what I need to do:

    https://unionassets.com/google-mobile-ads-sdk/initialization-182

    This is documentation for the Google Mobile Ad Plugin and not the Android Native plugin, but the Android Native Plugin documentation for Google Mobile Ad just links to here.

    There is of course no "Google Mobile Ad' settings in the Window menu.

    What are we supposed to instead? Do we just have to look through the API and figure out how to fill in these settings through code manually?

    Thanks
     
  41. MrTiger

    MrTiger

    Joined:
    Jan 9, 2014
    Posts:
    29
    Hi Lacost ,
    I tried a simple script but still i m not getting .. am i doing any thing wrong ? it is not even entering in to foreach Loop ..

    Note : I tried it in Unity Editor using Access Token and in my Android Mobile using my facebook ID too but it's not listing any name .
    Code (CSharp):
    1. using UnityEngine;
    2. using UnionAssets.FLE;
    3. using System.Collections;
    4. using UnityEngine.UI;
    5.  
    6. public class FaceBookLike : MonoBehaviour
    7. {
    8.     private static bool IsAuntificated = false;
    9.     public Text Status;
    10.  
    11.     void Awake()
    12.     {
    13.         SPFacebook.instance.Init();
    14.      
    15.     }
    16.  
    17.     public void Connect()
    18.     {
    19.         if(!IsAuntificated)
    20.         {
    21.             SPFacebook.instance.Login("email,publish_actions");
    22.             SA_StatusBar.text = "Log in...";
    23.             Debug.Log(SA_StatusBar.text);
    24.         }
    25.         else
    26.         {
    27.             LogOut();
    28.             SA_StatusBar.text = "Logged out";
    29.             Debug.Log(SA_StatusBar.text);
    30.         }
    31.     }
    32.  
    33.  
    34.  
    35.     public void LogOut()
    36.     {
    37.         IsAuntificated = false;
    38.      
    39.         SPFacebook.instance.Logout();
    40.     }
    41.  
    42.     public void CheckAllLike()
    43.     {
    44.         SPFacebook.instance.LoadCurrentUserLikes();
    45.      
    46.         foreach(FBLikeInfo like in SPFacebook.instance.GerUserLikesList(SPFacebook.instance.UserId)) {
    47.             Debug.Log("Current user likes: " + like.name);
    48.             Status.text = like.name;
    49.         }
    50.     }
    51. }    
     
  42. TheOz

    TheOz

    Joined:
    May 21, 2011
    Posts:
    34
    UPDATE: Thanks Stan, turns out I was pointing to the wrong keystore.
     
  43. TheOz

    TheOz

    Joined:
    May 21, 2011
    Posts:
    34
    Hey everyone, I have been having troubles with testing in app purchases and found this info on the prime31 site:

    Important Note: this is directly from Google and is a major change in how they handle IAP products. "We recently made some changes to our systems and we are now requiring an app to be published before testing. We are currently recommending to publish your APK to the Alpha channel in order to test licensing, in-app billing, and expansion files. There is no need to create a special testing group in the Alpha channel to test these features, however the app must be published and not in draft mode. We apologize for the inconvenience and are working to update our documentation to reflect these changes."

    Has anyone else found this to be true?
     
  44. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Well, sure because you need to wait before it load likes, you can not get data right after request. I just added the code snippet to show the proper way of likes retrieving at the end of this article.
    https://unionassets.com/mobile-social-plugin/likes-api-136


    Totally my bad, I will correct the documentation, yea, the ad uni id's should be added using scripting. here is updated article:
    https://unionassets.com/android-native-plugin/google-mobile-ad-178



    This is actually pretty old issue. And described in the plugin documentation.
    https://unionassets.com/android-native-plugin/billing-stopped-working-111

    Sharing my own experience, Recently we published our game to the Google Play, and I wasn't able to test purchases even with app publisher in Alpha and Beta channels. But as soon as app goes live in Production channel, all started to work well. So sometimes In-app testing not always work well.

    1) In most cases it's enough to publish the app to Beta channel and make sure your build has same Version Code as you published beta app.

    2) We always can test purchases with static responses to make sure our app reacts properly to purchase succsess and fail events.
     
  45. TheOz

    TheOz

    Joined:
    May 21, 2011
    Posts:
    34

    Thanks Stan, I found that in my case it actually tests ok if published to the alpha channel. The only thing that is giving me trouble now is when I add my products with addproduct and do a load store I get zero count for products loaded in the store. But they test fine in the alpha channel. Im using code out of the example for OnRetrieveProductsFinished

    not sure if its an bug or not.
     
  46. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    hi i am making admob with playmaker i need sample scene can you pls make a guide or scene as soon as possible
     
  47. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Can you try add products in the plugin settings?

    Here is basic explanation how to PM actions.
    https://unionassets.com/android-native-plugin/google-ad-with-playmaker-100

    I will try add example scene in the next updae.
    Cheers!
     
  48. alexsan75

    alexsan75

    Joined:
    Feb 6, 2012
    Posts:
    95
    1. Google Play Services example:
    right now it loads List of available Google accounts installed on device, but it's only possible to 'Sign In' with First one. It is quite common that there are several Google accounts installed on a device, and the one that needed isn't the first one )

    Q: is it possible to make it with Radio-buttons instead, use "Toggle UI" perhaps?
    not sure how to do that with Android native.. example or tips please?


    2. Twitter Example scene:
    is it working example? nothing happens when trying to test 'Connect' button.. Twitter app is installed on Android device. What is wrong here?

    Thanks!
     
  49. keburanuil

    keburanuil

    Joined:
    Oct 25, 2013
    Posts:
    9
    Hi Stan,

    We've been using your plugins for a year and overall we're satisfied.
    However there were lately some really annoying bugs in the Android-plugin.

    In Android Native 4.6 we received daily requests of people asking refund from their in-app purchases since they didn't receive them. It seemed like the OnProductPurchased-event wasn't working properly.

    Three days ago we updated to the latest plugin version (5.X) and the billing seemed to be working. But the update in our game went badly wrong. Most of whom updated to the latest version had really strange graphical issues (some sprites and texts were missing) and big part of this game was unplayable. We received hundreds of 1-star ratings. The last thing we did in our bug fixing process was that we downgraded the plugin to 4.6 and things started to work again.

    This bug happened only to those who updated their game. It didn't affect to the new users.

    Here's the Google Play version of the game:
    https://play.google.com/store/apps/details?id=com.TreetopCrew.VirtualBeggar
     
    Last edited: Dec 18, 2014
  50. anton_sl

    anton_sl

    Joined:
    Dec 10, 2014
    Posts:
    1
    Can somebody help me with social sharing (I have already surfed the web, but still have no answer)

    AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share");
    I looked at logs, but there are no information that relates to sharing intents. And I was also unable to run sharing from demo scene provided in package.

    May be I miss some configuration tricks in manifest or this functionality is broken by other plugins?

    Does nothing. I saw same question in unity forum and stackoverflow, but without answer.