Search Unity

[Released] Android Native Plugin

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

  1. BenoitFreslon

    BenoitFreslon

    Joined:
    Jan 16, 2013
    Posts:
    166
    Same here:

    Here the log :

    D/Unity (24505): Unloading 3 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    D/Unity (24505): Platform assembly: /mnt/asec/com.benoitfreslon.foodchain-1/pkg.apk/assets/bin/Data/Managed/System.dll (this message is harmless)
    I/Unity (24505): Play Serice Connection State -> STATE_CONNECTING
    I/Unity (24505): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity (24505): UnityEngine.Debug:Log(Object)
    I/Unity (24505): GooglePlayConnection:OnStateChange(GPConnectionState) (at /Users/Benoit/UnityAndroid/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:169)
    I/Unity (24505): GooglePlayConnection:connect() (at /Users/Benoit/UnityAndroid/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:61)
    I/Unity (24505): Main:OnEnable() (at /Users/Benoit/UnityAndroid/Assets/Main.cs:32)
    I/Unity (24505):
    I/Unity (24505): (Filename: /Users/Benoit/UnityAndroid/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs Line: 169)
    I/Unity (24505):
    I/Unity (24505): GooglePlayManager was created
    I/Unity (24505): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity (24505): UnityEngine.Debug:Log(Object)
    I/Unity (24505): GooglePlayManager:Create() (at /Users/Benoit/UnityAndroid/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayManager.cs:50)
    I/Unity (24505): GooglePlayConnection:connect() (at /Users/Benoit/UnityAndroid/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:63)
    I/Unity (24505): Main:OnEnable() (at /Users/Benoit/UnityAndroid/Assets/Main.cs:32)
    I/Unity (24505):
    I/Unity (24505): (Filename: /Users/Benoit/UnityAndroid/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayManager.cs Line: 50)
    I/Unity (24505):
    I/Unity (24505): OnConnectionResultSIGN_IN_REQUIRED
    I/Unity (24505): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity (24505): UnityEngine.Debug:Log(Object)
    I/Unity (24505): Main:OnConnectionResult(CEvent) (at /Users/Benoit/UnityAndroid/Assets/Main.cs:61)
    I/Unity (24505): EventDispatcher:dispatch(Int32, Object, String) (at /Users/Benoit/UnityAndroid/Assets/Extensions/FlashLikeEvents/Events/Core/Events/EventDispatcher.cs:177)
    I/Unity (24505): EventDispatcher:dispatch(String, Object) (at /Users/Benoit/UnityAndroid/Assets/Extensions/FlashLikeEvents/Events/Core/Events/EventDispatcher.cs:151)
    I/Unity (24505): GooglePlayConnection:OnConnectionResult(String) (at /Users/Benoit/UnityAndroid/Assets/Extensions/AndroidNative/PlayService/Manage/GooglePlayConnection.cs:150)
    I/Unity (24505):
    I/Unity (24505): (Filename: /Users/Benoit/UnityAndroid/Assets/Main.cs Line: 61)
    I/Unity (24505):


    And the C# file:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class Main : MonoBehaviour
    5. {
    6.  
    7.         // Use this for initialization
    8.         void Start ()
    9.         {
    10.                 //listen for GooglePlayConnection events
    11.                 GooglePlayConnection.instance.addEventListener (GooglePlayConnection.PLAYER_CONNECTED, OnPlayerConnected);
    12.                 GooglePlayConnection.instance.addEventListener (GooglePlayConnection.PLAYER_DISCONNECTED, OnPlayerDisconnected);
    13.                 GooglePlayConnection.instance.addEventListener (GooglePlayConnection.CONNECTION_RESULT_RECEIVED, OnConnectionResult);
    14.      
    15.      
    16.                 //listen for GooglePlayManager events
    17.                 //GooglePlayManager.instance.addEventListener (GooglePlayManager.ACHIEVEMENT_UPDATED, OnAchivmentUpdated);
    18.                 //GooglePlayManager.instance.addEventListener (GooglePlayManager.SCORE_SUBMITED, OnScoreSubmited);
    19.  
    20.         }
    21.  
    22.         // Update is called once per frame
    23.         void Update ()
    24.         {
    25.                 if (Input.GetMouseButtonUp (0)) {
    26.                         AndroidNative.showLeaderBoardById ("MYIDHIDDEN");
    27.                 }
    28.         }
    29.         void OnEnable ()
    30.         {
    31.                 AndroidNativeSettings.Instance.EnableGamesAPI = true;
    32.                 GooglePlayConnection.instance.connect ();
    33.         }
    34.         void FixedUpdate ()
    35.         {
    36.                 string title = "Connect";
    37.      
    38.                 if (GooglePlayConnection.state == GPConnectionState.STATE_CONNECTED) {
    39.                         title = "Connected";
    40.                 } else if (GooglePlayConnection.state == GPConnectionState.STATE_DISCONNECTED) {
    41.                         title = "Disconnected";
    42.                 } else if (GooglePlayConnection.state == GPConnectionState.STATE_UNCONFIGURED) {
    43.                         title = "STATE_UNCONFIGURED";
    44.                 }
    45.                 GameObject.Find ("State").GetComponent<GUIText> ().text = title;
    46.         }
    47.         private void OnPlayerDisconnected ()
    48.         {
    49.                 Debug.Log ("OnPlayerDisconnected");
    50.         }
    51.  
    52.         private void OnPlayerConnected ()
    53.         {
    54.                 Debug.Log ("OnPlayerConnected");
    55.         }
    56.  
    57.         private void OnConnectionResult (CEvent e)
    58.         {
    59.                 GooglePlayConnectionResult result = e.data as GooglePlayConnectionResult;
    60.      
    61.                 Debug.Log ("OnConnectionResult" + result.code.ToString ());
    62.         }
    63. }
    64.  
    I added my Google account to testing in android console.
    I didn't have this problem in Unity 4.3 with the old version of AndroidNative.

    Thanks.
     
  2. kokkorollo

    kokkorollo

    Joined:
    Jan 16, 2013
    Posts:
    9
  3. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Android Native has everything you need for twitter and facebook, if yo have any troubles using it, feel fre to drop an e-mail.

    If you do not need twitter oAuth, you can simply remove this jar.
    If that is not and option for you, just describe more about your conflict or send me e-mail, I will do my best to solve this.
    Cheers!
     
    skullthug likes this.
  4. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Thanks for report I will check this!


    That is common problem if your hash key is wrong, just check it once again please.
    https://docs.google.com/document/d/..._06bk3weoVOOD-0nY/edit#heading=h.2fae4js7xc3a

    Cheers!
     
  5. MarkHenderson

    MarkHenderson

    Joined:
    Oct 28, 2013
    Posts:
    16
    Hi,

    How do I disable Facebook in this plugin?

    I'm using several of the contained services, but I'm not using facebook at all.

    When I try to run my game in android, I get

    (Not sure if it's related, but when I start up my app on android it's completely frozen, which wasn't happening before I started getting this error)
     
    Last edited: Jun 13, 2014
  6. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hey abdben, I have tested your issue, and it seem to work perfect for me. I ma using latest plugin version and Unity 4.5.
    I will send you PM will latest plugin version, will see if it helps.

    Sure, you can disable and remove Facebook completely if you not using it. here is instruction how you can do this:
    https://docs.google.com/document/d/...edit?disco=AAAAAKM77L8#heading=h.25anb5kzj9at

    Cheers!
     
  7. BenoitFreslon

    BenoitFreslon

    Joined:
    Jan 16, 2013
    Posts:
    166

    Thanks for your support.

    Your last version doesn't work anymore but I think I missed or modified something on Google Developer console.

    I will try again later.
     
  8. MonkeyPig

    MonkeyPig

    Joined:
    Jul 22, 2013
    Posts:
    2
    So - it's a decent(ish) solution for Native Android functionality. I really only needed the leaderboard functionality from your SDK so my experiences are largely related to that. I was already using Chartboost and Unibills as cross platform solutions for Ads. and Billing respectively. I was eventually able to get the AndroidNative Jar building without conflict after much messing about. I realize that for $30.00 one cannot expect a perfect solution for each use case - but you really would be better served by creating a series of smaller packages than can be imported that cover likely scenarios. The Chartboost instructions are a great help but are inaccurate - for example the onStart Append instructions. There is no onStart method in the AndroidNativeBridge.java class.
     
    Deleted User likes this.
  9. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hello. Thanks for sharing your experience. That is really helpful info, I will try to improve my product for people who using it like you do.

    Cheers!
     
  10. electricpunch

    electricpunch

    Joined:
    Feb 18, 2014
    Posts:
    22
    Hi, lacost! I added admob interstetial ads to my game. Can you explain the difference between StartInterstitialAd(), LoadInterstitialAd() and ShowInterstitialAd() methods? Whether to call all three methods, or simply call StartInterstitialAd()?
     
  11. Cheshire Cat

    Cheshire Cat

    Joined:
    Sep 18, 2012
    Posts:
    39
    Hi lacost,
    I've just downloaded your plugin while the main purpose of using it was to send notifications to the upper notification bar, ideally with an icon. It seems that this functionality is not implemented, am I right? If it is, can you please guide me how to do it? If not, are you planning to implement this in the nearest future?
    10x
     
  12. Cheshire Cat

    Cheshire Cat

    Joined:
    Sep 18, 2012
    Posts:
    39
    Hi again, just got into a critical issue trying to compile the imported asset: firstly I had to deal with the fact that both your code and one of the previously imported plugins has a Singleton<T> class; after resolving it got a weird compiler error which I'm trying to resolve a couple of hours with no result:

    Unhandled Exception: Mono.CSharp.InternalErrorException: Internal error

    at Mono.CSharp.MethodGroupExpr.IsApplicable (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& arguments, Int32 arg_count, System.Reflection.MethodBase& method, System.Boolean& params_expanded_form) [0x00000] in <filename unknown>:0

    at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& Arguments, Boolean may_fail, Location loc) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.FlowBranching parent, Mono.CSharp.BlockContext rc, Mono.CSharp.ParametersCompiled ip, IMethodData md) [0x00000] in <filename unknown>
    :0

    The worst thing is that after removing the "Extension" folder completely and reverting all the changes in the SVN, I'm still getting the error, so my whole project gets corrupted.
    Please advise,
    10x
     
    Last edited: Jun 16, 2014
  13. Cheshire Cat

    Cheshire Cat

    Joined:
    Sep 18, 2012
    Posts:
    39
    Well, resolved the problem by re-importing the whole Facebook unity package. I'm not sure why, but your asset crashes the Mono compiler somewhere in FB code. May be the reason is API difference between the SDK versions (mine was 5.0.3) as described here - http://stackoverflow.com/questions/...-the-new-facebook-5-1-sdk-into-my-existing-pr or may be it was a using of a named parameters. Anyway, consider specifying FB SDK version your asset work with and describe this possible error in the docs.
     
    Last edited: Jun 16, 2014
  14. BenoitFreslon

    BenoitFreslon

    Joined:
    Jan 16, 2013
    Posts:
    166
    Hello lacost,

    I test your plugin version 3.9a with Unity 4.5 with a fresh project but I can't show up the leaderboard anymore.

    Here the log on Android.


    2nd problem I go this message on log with the Android Native plugin.

    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)
    D/Unity (10767): Unknown event structure (0)

    You can download the entire project here, just replace your app ID:

    https://www.dropbox.com/s/gv0g6oq15gsa0ua/AndroidEmpty.zip

    Thanks. Waiting for your response. This is the last issue. The Native iOS plugin is OK :).

    FIXED: I FORGOTTEN TO CONFIGURE GOOGLE PLAY IDS.
    Android/res/values/ids.xml
     
    Last edited: Jun 16, 2014
  15. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    I am trying to impliment the google admob into my game.
    I am following the Google Mobile Ad documentation. I deleted the asset from my project and reimported it. Says version 3.8.
    I have my admob ID and put that in the Adnroid Ad Mob Banner script. I opened the androidmanifest.xml and for where you have replace with package name. Are you saying to replace it with the admob ID or something else? I put in the Admob ID but went to build the app and got this error:

    Error building Player: Win32Exception: ApplicationName='C:\Program Files (x86)\Java\jre7\bin\javac.exe', CommandLine='-bootclasspath "E:/Unity Stuff/Android SDK/adt-bundle-windows-x86_64-20131030/sdk/platforms/android-19\android.jar" -d "E:\Unity Stuff\Unity 4 Projects\Current Projects\Infinite Rider\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding ascii "com\Archaniawork\EndlessMotorcycle\Manifest.java" "com\Archaniawork\EndlessMotorcycle\R.java" "com\facebook\android\Manifest.java" "com\facebook\android\R.java"', CurrentDirectory='E:\Unity Stuff\Unity 4 Projects\Current Projects\Infinite Rider\Temp\StagingArea\gen'

    Not sure what I am doing wrong here.
    Any help would be great.
    Thanks

    Edit: I put the info from the Identification for Player Settings into the xml file - Bundle Identifier, Version, and version code.
    Does the Minimum API Level need to be set to a specific one?
    When I did this I am now getting this error on build:
    Error building Player: Win32Exception: ApplicationName='C:\Program Files (x86)\Java\jre7\bin\javac.exe', CommandLine='-bootclasspath "E:/Unity Stuff/Android SDK/adt-bundle-windows-x86_64-20131030/sdk/platforms/android-19\android.jar" -d "E:\Unity Stuff\Unity 4 Projects\Current Projects\Infinite Rider\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding ascii "com\Archaniawork\EndlessMotorcycle\Manifest.java" "com\Archaniawork\EndlessMotorcycle\R.java" "com\facebook\android\Manifest.java" "com\facebook\android\R.java"', CurrentDirectory='E:\Unity Stuff\Unity 4 Projects\Current Projects\Infinite Rider\Temp\StagingArea\gen'

    Can I delete everything that has to do with Facebook? Not using it....
     
    Last edited: Jun 17, 2014
  16. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Sure.
    StartInterstitialAd()
    Will load and show the ad after it's loaded.

    LoadInterstitialAd()
    Will only load ad content, and let you know that content is loaded by firing the event.

    ShowInterstitialAd()
    Will show ad immediately, if ad content was perviously loaded by LoadInterstitialAd() function


    Are you talking about push or local notifications?


    I glad you fixed it!

    I am trying to answer on forum at leas one a day.
    But some times it can take up to 3 days. If you have something urgent, just drop me and e-mail you will get answer in few hours.
    Depend of your question you can choose between e-mailing me directly or asking support team.

    Cheers! :)
     
  17. MarkHenderson

    MarkHenderson

    Joined:
    Oct 28, 2013
    Posts:
    16
    I'm having a problem with the billing plugin - specifically, I don't seem to be able to get it to fetch any info for any of my IAP SKUs.

    I've checked that the public key is correct (set via the Window ->Android Native -> Edit settings page) and that it's being passed down to the native library


    I added a log statement to AndroidInAppPurchaseManager to check the SKU's being requested, and they appear correct:
    Code (CSharp):
    1. Debug.Log ("Adding product "+ids);
    2. AndroidNative.connectToBilling (ids, base64EncodedPublicKey);

    I've verified that Billing Helper is using the correct package name

    I have 2 products active on the google play console (coin_pack and indie_love_bundle). I activated them almost 20 hours ago. (see Capture.PNG, attached)


    I can see log statements from BillingHelper listing the 4 test products
    But there's nothing for my store products.

    Is there anything else I can check or do to debug this? Any way to verify that it's connecting to the correct app on google play developer console?

    Thanks
     

    Attached Files:

  18. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Pretty odd.
    I do not event know what to suggest here :) Never had such case before.

    Let's just connect to billing with only your products (with out android test products).
    simply add your product to plugin settings
    Window ->Android Native -> Edit settings page

    Try example scene and send me full log file.
    Just remove this lines from GPaymnetManagerExample before doing this.
    Code (CSharp):
    1. //Filling product list
    2.  
    3.         //When you will add your own proucts you can skip this code section of you already have added
    4.         //your products ids under the editor setings menu
    5.         AndroidInAppPurchaseManager.instance.addProduct(ANDROID_TEST_PURCHASED);
    6.         AndroidInAppPurchaseManager.instance.addProduct(ANDROID_TEST_CANCELED);
    7.         AndroidInAppPurchaseManager.instance.addProduct(ANDROID_TEST_REFUNDED);
    8.         AndroidInAppPurchaseManager.instance.addProduct(ANDROID_TEST_ITEM_UNAVALIABLE);
     
  19. shopguy

    shopguy

    Joined:
    Jan 12, 2013
    Posts:
    282
    For billing, does this plug-in use version 3 of the Google API, or version 2? I'm interested in version 3 because of the new local caching features.

    If all I use is in-app billing, approx. how much will this increase the size of my final APK? I want to keep my APK download size as small as possible, it is currently under 13MB.
     
  20. MarkHenderson

    MarkHenderson

    Joined:
    Oct 28, 2013
    Posts:
    16
    I tried with those commented out originally, and only brought them back in when I couldn't get it to work.

    I suppose I'll keep banging my head against this until something sticks then. Thanks for your help.
     
  21. Stans-Assets

    Stans-Assets

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



    New Features:
    Package Info Load API
    PlayMaker Actions Updated
    AndroidInAppPurchaseManager, state flags added

    Fixes:
    GooglePurchaseTemplate, originalJson retrieval fixed.
    Manifest comment more clear now
    Leaderboard Custom GUI

    Code Refactor:
    Removed:

    Assets/Extensions/AndroidNative/Other/Twitter
    All Scene under xExample/Scenes Moved to corresponding folder
    only Preview Scene should be under xExample/Scenes

    Added:
    Assets/Extensions/GooglePlayCommon/Social/Twitter/Manage
     
  22. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    The version 3 of the Google API is implemented.
    I will not add much size to your app, I pretty sure size will be increased less then for 500Kb, the is no graphics, only scripts and libraries.
    How ever plugin come with Unity Facebook SDK, witch can increase your project size. but you can remove it.
    Here is instruction how.
     
  23. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hey MarkHenderson.
    I always try to help my customers as much as possible. I even hire support team :)
    So here is what you can do if problem steel not solved for you.
    1) Send your project, with problem description to stans.assets@gmail.com
    2) Send your keystore + access info
    3) Add stans.assets@gmail.com as developer yo your google console.

    And one of support guys will work on your problem.
    Cheers!
     
  24. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Is there a upgrade guide for the latest version.

    I am having problems because I built my game around the old interface. Some of the issues I am having are:


    This event no longer exists:
    GooglePlayConnection.instance.addEventListener(GooglePlayConnection.CONNECTION_INITIALIZED, OnConnectionInitialized)

    This event no longer exists (Constant was renamed):
    GooglePlayManager.instance.addEventListener (GooglePlayManager.PLAYER_LOADED, OnPlayerInfoLoaded);

    This method no longer exists:
    GooglePlayConnection.instance.start (GooglePlayConnection.CLIENT_GAMES | GooglePlayConnection.CLIENT_APPSTATE );

    This method no longer exists:
    GooglePlayManager.instance.loadPlayer ();

    Also, you renamed your Singletone class to Singleton, I understand you were just correcting the spelling, however this now clashes with the popular sound manager pro plugin. Their's is defined in their own namespace but your is global and so it takes precedence and breaks their plugin.

    Thx
     
    Last edited: Jun 22, 2014
  25. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Thanks a lot for the report.
    Basic upgrade guide can be found here:
    https://docs.google.com/document/d/...NYaCYTxXnn4eS4ytY/edit#heading=h.p439r0wkiitt



    Here is list of event you ca use instead:
    Code (CSharp):
    1. GooglePlayConnection.instance.addEventListener (GooglePlayConnection.PLAYER_CONNECTED, OnPlayerConnected);
    2.         GooglePlayConnection.instance.addEventListener (GooglePlayConnection.PLAYER_DISCONNECTED, OnPlayerDisconnected);
    3.         GooglePlayConnection.instance.addEventListener(GooglePlayConnection.CONNECTION_RESULT_RECEIVED, OnConnectionResult);


    You do not have to do this anymore. the player is loaded as soon as connection is establisher. PLAYER_CONNECTED event


    it's changed to
    Code (CSharp):
    1. GooglePlayConnection.instance.disconnect ();
    And you can spesifay what scopes you whant to use with connection using plugin Editor menu
    Windows -> Android Native -> Edit Settings




    Yea. I guess it was bad move. I will rename it something like SA_Singleton in next update.



    Cheers!
     
  26. stonehands

    stonehands

    Joined:
    Oct 8, 2013
    Posts:
    1
    Hello,

    I wonder if you have a plan to add google gift api soon.
    Thank you in advance.

    -Henry
     
  27. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Thanks for the reply and tips. I am now back up and running.

    One other area that I think is worth mentioning and might help others, is that the XML also needs some adjustments. In a couple places you need to replace android with androidnative:

    <activity android:name="com.androidnative.AndroidNativeBridge" android:label="mygame" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:launchMode="singleTask" android:screenOrientation="landscape">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <!-- Twitter -->
    <intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="oauth" android:host="androidnative" />
    </intent-filter>

    <!-- Google Cloud Message Block Start -->
    <receiver android:name="com.androidnative.features.notifications.LocalNotificationReceiver"> </receiver>
    <receiver android:exported="true" android:name="com.androidnative.gcm.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
    <intent-filter>
    <action android:name="com.google.android.c2dm.intent.RECEIVE" />
    <category android:name="com.unionassets.android.plugin.preview">
    </intent-filter>
    </receiver>
    <service android:name="com.androidnative.gcm.GcmIntentService" />
     
    Last edited: Jun 24, 2014
  28. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Yep, already in TODO list.


    Thanks a lot for report. On it,

    Cheers!
     
  29. MarkHenderson

    MarkHenderson

    Joined:
    Oct 28, 2013
    Posts:
    16
    Thanks a lot for the offer, though I wound up sorting it out myself.
    As mentioned in this question on Stack overflow, Google has recently changed the way pre release IAP testing can happen. You now need to publish the app (to alpha testing, at least) before getSKUDetails will return anything.

    Only action I can think of that you could take to help prevent this in the future is to mention that in your setup guide.
     
  30. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Well, this is mentioned in the docs at the Set up and FAQ sections . Probably I wasn't not enough clear there.
    I will try to improve documentation. thanks for the report.
    Cheers!
     
  31. KS_Vince

    KS_Vince

    Joined:
    Feb 28, 2013
    Posts:
    5
    I bought this plugin to display local notifications.
    Is there any way to cancel already scheduled notifications ?
     
  32. jeroenx000

    jeroenx000

    Joined:
    Oct 4, 2012
    Posts:
    27
    Good Day!

    I'm doing in app billing,

    and I am using your GameBillingManagerExample.cs to test, changing the items to mine.
    sadly it doesn't work.

    i am initializing it and loading the store.

    what are the other scripts needed in scene? or am I missing something?

    I also followed the documentation, putting my keys and changing the manifest

    though it is working on the example scene.

    Thanks,
     
    Last edited: Jul 2, 2014
  33. keomanla

    keomanla

    Joined:
    Jan 30, 2012
    Posts:
    26
    Hi, recently I got this bug from google admob and the games is crashed, there is a branch new thread on stackoverflow too.

    07-02 18:34:38.860: W/Ads(21988): Interrupted during GADSignals creation.
    07-02 18:34:38.860: W/Ads(21988): java.lang.InterruptedException
    07-02 18:34:38.860: W/Ads(21988): at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:975)
    07-02 18:34:38.860: W/Ads(21988): at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1282)
    07-02 18:34:38.860: W/Ads(21988): at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:207)
    07-02 18:34:38.860: W/Ads(21988): at zo.a(SourceFile:147)
    07-02 18:34:38.860: W/Ads(21988): at zo.a(SourceFile:170)
    07-02 18:34:38.860: W/Ads(21988): at aeh.a(SourceFile:120)
    07-02 18:34:38.860: W/Ads(21988): at afw.run(SourceFile:14)
    07-02 18:34:38.860: W/Ads(21988): at afy.run(SourceFile:30)
    07-02 18:34:38.860: W/Ads(21988): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
    07-02 18:34:38.860: W/Ads(21988): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
    07-02 18:34:38.860: W/Ads(21988): at java.lang.Thread.run(Thread.java:856)


    http://stackoverflow.com/questions/24457689/google-play-services-5-0-77
     
  34. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Will be added in next releases.

    Well it's really hard to say what you missed without seeing the log.
    Have you published your game in alpha channel?


    Thanks for letting us know, emperor1412. Hopefully Google will fix it shortly.

    Cheers!
     
  35. keomanla

    keomanla

    Joined:
    Jan 30, 2012
    Posts:
    26
    Hi, I am testing on this bug too, what I found out is that using this https://github.com/googleads/googleads-mobile-plugins, I didn't observe the crash, the ads just showed up normally. But when I integrate it into the project that I also use androidnative plugin then it crash, and produce a log like that. This means there could be a potential bug inside the plugin too.
    It would be great if you could double check this.
     
  36. jeroenx000

    jeroenx000

    Joined:
    Oct 4, 2012
    Posts:
    27
    yes, it is published on alpha and we have a test account, how and where can I get the logs? should I use an emulator?

    is there a file needed on the scene? or just initializing the billing manager is already fine?
     
  37. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Thanks for letting me know. I will defiantly check this!


    You can get log-cat log from your device awith any app you like.
    Or use console:
    http://developer.android.com/tools/help/logcat.html

    The billing will not work on emulator. So you should use only real device.


    You do not have to put anything to your scene. Just use init function.
    Cheers!
     
  38. jeroenx000

    jeroenx000

    Joined:
    Oct 4, 2012
    Posts:
    27
    so It is now working, my bad. I was using .consume when the user taps on the button. instead of purchase then going to consume.
     
  39. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Glad to hear that your problem is solved :)
     
  40. UziLullaby

    UziLullaby

    Joined:
    Jul 4, 2014
    Posts:
    6
    Hello.

    I purchased this awesome package and IAP billing seems to be working just fine.
    I just have a question:

    Is there a way to implement a "Restore Purchases" functionality? I couldn't find any methods implemented for this purpose.
    I wanna add that button for players who install the game in a different device so that they don't have to purchase the item again.
     
  41. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hello "Restore Purchases" - this is IOS way. There is no such thinks in android.

    Here is the videos with explanations:




    Cheers!
     
  42. jeroenx000

    jeroenx000

    Joined:
    Oct 4, 2012
    Posts:
    27
    got a question on play services, do I need to load leaderboards first before showleaderboard? can you help me how to implement your play services to show achievements/leaderboards. your example scene works fine.

    i am initializing it, and then if the user taps the button I call showleaderboards.
    specifically this:

    Code (CSharp):
    1. public void showLeaderBoard(int id)
    2.     {
    3.         switch (id)
    4.         {
    5.         case 1:
    6.             GooglePlayManager.instance.showLeaderBoardById (LEADERBOARD_ID);
    7.             Debug.Log("SHOW LEADERBOARD 1");
    8.             break;
    9.  
    10.         case 2:
    11.             GooglePlayManager.instance.showLeaderBoardById (LEADERBOARD_ID2);
    12.             Debug.Log("SHOW LEADERBOARD 2");
    13.             break;
    14.         }
    15.  
    16.     //    SA_StatusBar.text = "Shwoing Leader Board UI for " + LEADERBOARD_ID;
    17.     }
     
    Last edited: Jul 7, 2014
  43. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    You can who leaderboards GUI right after user is successfully connected to play service.


    Sounds correct.
     
  44. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
  45. FerhatSener

    FerhatSener

    Joined:
    Jul 8, 2014
    Posts:
    2
    Is there any built-in way to reset achievement for currently logged-in user ?
     
  46. Deleted User

    Deleted User

    Guest

    you were right, somehow, an earlier version sneaked in to a 3.5 project, that needed to be upgraded to 4.5, I have way too many unity projects on my system...My fault...sorry to bother you!! p-
     
  47. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Added to the TODO list :)


    Yep, will be implemented in new plugin release.


    No problem I just glad that issue is solved
    Cheers!
     
  48. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Hi,

    Is it possible to add a method / action to check if a banner already exist ?

    Thanks
     
  49. jeroenx000

    jeroenx000

    Joined:
    Oct 4, 2012
    Posts:
    27
    hi having some facebook post problems,

    Code (CSharp):
    1.  
    2. void Awake() {
    3.    
    4.         AndroidTwitterManager.instance.Init();
    5.         SPFacebook.instance.Init();
    6.          GooglePlayConnection.instance.connect ();
    7.     }
    8.  
    9. if (hit.collider.gameObject.name == "Facebook")
    10. {
    11.     if (SPFacebook.instance.IsLoggedIn)
    12.      {
    13.         SPFacebook.instance.Post("...");
    14.     }
    15.     else
    16.     {
    17.          SPFacebook.instance.Login();
    18.         SPFacebook.instance.PostWithAuthCheck("...");
    19.     }
    20.  
    21. }
    22.  
    I wonder if I'm doing the hash key thing right. what should I post with it?
    the hash key is for facebook only right?
    if I'm gonna post my hash key here is there something I need to censor?

    keytool -exportcert -alias <alias_name> -keystore <path_to_keystore> | openssl sha1 -binary | openssl base64

    is the <alias_name> the file name? or the key alias?

    we are on alpha btw

    7-11-2014 example scene works. what am I missing?
     
    Last edited: Jul 11, 2014
  50. Kazowatti

    Kazowatti

    Joined:
    Aug 6, 2013
    Posts:
    3
    Hi,
    Is there a way to use the plugin to send SMS messages or e-mail?
    Thanks in advance,
    Carlos.