Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

[Released] Android Native Plugin

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

  1. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,352
    Would be totally awesome if you could add this functionality so we can natively work with the native device database. Would you consider a request to add this very needed feature in a future update.

    Cheers.
     
  2. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,055
    On each update of your plugin if i forget to deselect that file it overrides AndroidManifest.xml file. do you have any suggestion to keep custom changes on this file?

    I think you implemented major functions in AdMob like Gender. For example i need birthdate like this;

    Code (csharp):
    1. AdRequest request = new AdRequest.Builder()
    2.     .setGender(AdRequest.GENDER_FEMALE)
    3.     .setBirthday(new GregorianCalendar(1985, 1, 1).getTime())
    4.     .setLocation(location)
    5.     .build();
    how can i do that?
     
  3. ForceVFX

    ForceVFX

    Joined:
    Jan 21, 2011
    Posts:
    593
    I think it has nothing to do with your plug-in, and EVERYTHING to do with my Legacy Game Services data..even though I only started using game services in jan - 2014, it was with the NerdGPG Game Services Older Version[File Size 867KBs), That data, specifically OLD AC.List, was trying to get cached through the NEW Game Services [File Size 1.4KBs)framework, that's why when i tried to go back to my game, CRASH..
    Dalvik.vm Fatal Error AC.List (or something like that)..I finally got eclipse debug with filters going...
    I don't know exactly what value or why,But when I updated my Working Projects GameServices.jar using the NerdGPG..It Failed at that same point!!!, put in the old GameServices.jar...it worked..and I can not use your AdMod Plugin because it relies on new GameServices.jar..it is all or nothing.

    But My New Games Will Use your Plugin!!!
    Thanks for the reply!!
    Patrick
     
    Last edited: May 1, 2014
  4. Livealot

    Livealot

    Joined:
    Sep 2, 2013
    Posts:
    221
    I don't think the plugin supports multiplayer (yet). But I think it does support the preliminary steps of logging the user into Google Play and connecting to GoogleAPIClient. So to implement a turn-based game in Google Play I just want to make sure where we need to start building on top of the plugin.

    If you look at the google documentation I think the plugin completes the "Before You Begin" section.

    Is that accurate?
     
  5. ForceVFX

    ForceVFX

    Joined:
    Jan 21, 2011
    Posts:
    593
    I am trying to find out if my player has unlocked the many achievements I have , my old code is not working and I fail to find a way to do this..I feel really DUMB!!

    Can you take look and offer me a suggestion on how to work with Dictionary object in C# ??

    Code (csharp):
    1.                 AndroidNative.showMessage ("OnAchivmentsLoaded", "Total Achivments: " + GooglePlayManager.instance.achievements.Count.ToString());
    2.                 foreach (GooglePlayManager.achievements ac in GooglePlayManager.instance.achievements)
    3.                     {
    4.                         if (ac.id == CombatVeteran)
    5.                             {
    6.                                 currACPercent = ac.percentCompleted;
    7.                             }
    8.                         if (ac.id == FlightCadet)
    9.                             {
    10.                                 currACPercent_cadet = ac.percentCompleted;
    11.                             }
    12.                         if (ac.id == ZeroAce)
    13.                             {
    14.                                 currACPercent_zAce = ac.percentCompleted;
    15.                             }
    16.                         if (ac.id == StukaAce)
    17.                             {
    18.                                 currACPercent_sAce = ac.percentCompleted;
    19.                             }
    20.                         if (ac.id == TopZeroAce)
    21.                             {
    22.                                 currACPercent_TzAce = ac.percentCompleted;
    23.                             }
    24.                         if (ac.id == TopStukaAce)
    25.                             {
    26.                                 currACPercent_TsAce = ac.percentCompleted;
    27.                             }
    28.                     }
    Thanks..


    Patrick
     
  6. seanbro

    seanbro

    Joined:
    Apr 25, 2013
    Posts:
    13
    I just updated and I'm getting many errors like these below. Any ideas on how to fix this?
    Code (csharp):
    1.  
    2. Assets/Extensions/AndroidNative/Other/Ad/AndroidAdMobController.cs(13,39): error CS0246: The type or namespace name `Singletone`1' could not be found. Are you missing a using directive or an assembly reference?
    3. Assets/Extensions/AndroidNative/Other/Ad/AndroidAdMobController.cs(13,75): error CS0246: The type or namespace name `GoogleMobileAdInterface' could not be found. Are you missing a using directive or an assembly reference?
    4. Assets/Extensions/AndroidNative/Other/Twitter/AndroidTwitterManager.cs(12,73): error CS0246: The type or namespace name `TwitterManagerInterface' could not be found. Are you missing a using directive or an assembly reference?
    5.  
    Edit: Is there supposed to be an "Assets/Extensions/AndroidNative/Core" folder like the previous version? The latest update doesn't include "AndroidNative.cs", I think that is the problem.

    Edit2: You put the "Core" folder in "Assets/Extensions/GooglePlayCommon", after moving it back to "Assets/Extensions/AndroidNative" everything works.
     
    Last edited: May 2, 2014
  7. bWard

    bWard

    Joined:
    Jul 21, 2012
    Posts:
    5
    I've connected to the store, can buy purchases and whatnot, and now I want to display the price in-game. I found this GetProductDetails function, but I'm only getting null for the product.

    Below is my code. The SKU is correct, and can be purchased in-game, but still returns null. There aren't instructions or examples in the code or documentation, so I'm not sure where to go next. Am I using it wrong? Should I look at other functions? Should it not be called in the OnRetrive function?



    Code (csharp):
    1. private static void OnRetriveProductsFinised(CEvent e) {
    2.         BillingResult result = e.data as BillingResult;
    3.         AndroidInAppPurchaseManager.instance.removeEventListener (AndroidInAppPurchaseManager.ON_RETRIEVE_PRODUC_FINISHED, OnRetriveProductsFinised);
    4.         if(result.isSuccess) {
    5.             AndroidMessage.Create("Prices", "Gathering Prices");
    6.             GoogleProductTemplate book = AndroidInAppPurchaseManager.instance.inventory.GetProductDetails("unit1book2");
    7.             if (book == null) {
    8.                 AndroidMessage.Create("Prices", "The product is null.");
    9.                 return;
    10.             }
    11.             AndroidMessage.Create("Prices", book.price);
    12.             _isInited = true;
    13. }

    EDIT: Looks like page 5 had the answer. addProduct() was the answer. I was wondering what the add product function was for, since products can be purchased without it.
    Code (csharp):
    1.  
    2. AndroidInAppPurchaseManager.instance.addProduct("unit1book2");
    3. AndroidInAppPurchaseManager.instance.loadStore(base64EncodedPublicKey);
    4.  
     
    Last edited: May 3, 2014
  8. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,055
    i lacost, can you check Phone 8 build with your plugin?

    i get following error;

    Code (csharp):
    1. Error building Player: Exception: Error: method `System.String System.Text.Encoding::GetString(System.Byte[])` doesn't exist in target framework. It is referenced from Assembly-CSharp.dll at System.String GoogleCloudResult::get_stateDataString().
    2. Error: method `System.String System.Text.Encoding::GetString(System.Byte[])` doesn't exist in target framework. It is referenced from Assembly-CSharp.dll at System.String GoogleCloudResult::get_serverConflictDataString().
     
  9. keburanuil

    keburanuil

    Joined:
    Oct 25, 2013
    Posts:
    9
    Chartboost integration would be awesome.
     
  10. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,055
    Hi lacost,

    i just bought your Google Analytics SDK plugin. i think there is no unity thread for this plugin so i write here. i used your android native plugin to use google analytics on my android build. i need GA for my Windows Phone 8 and iOS build so i bought Google Analytics SDK plugin. in native plugin i used it as View. how can i use view with Google Analytics SDK plugin? Does Google Analytics SDK plugin support Google Universal Analytics?
     
  11. fabiobh

    fabiobh

    Joined:
    May 28, 2013
    Posts:
    90
    Hi, I use this plugin in .cs file. It works perfectly, but when I try to use it in .js file, the AndroidAdMobController is not working. I need to import something?
     
  12. paala

    paala

    Joined:
    Mar 24, 2014
    Posts:
    17
    The docs should include documentation on how to recreate the jar file using eclipse.
    This is needed when you want to implement chartboost other plugins that want to ovverride unity main activity.

    Thanks
     
  13. daithis

    daithis

    Joined:
    May 6, 2014
    Posts:
    1
    hello,
    i tried to use ur google moible ads SDK, just use example scene, build and run on android 4.0.3 and 4.1.1, it crashes at the beginning.

    here is log i got, can u check it:

    E/AndroidRuntime( 1280): FATAL EXCEPTION: main
    E/AndroidRuntime( 1280): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sam2.test1/com.android.AndroidNativeBridge}: java.lang.IllegalArgumentException: Unable to find native library: main
    E/AndroidRuntime( 1280): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
    E/AndroidRuntime( 1280): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
    E/AndroidRuntime( 1280): at android.app.ActivityThread.access$600(ActivityThread.java:130)
    E/AndroidRuntime( 1280): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
    E/AndroidRuntime( 1280): at android.os.Handler.dispatchMessage(Handler.java:99)
    E/AndroidRuntime( 1280): at android.os.Looper.loop(Looper.java:137)
    E/AndroidRuntime( 1280): at android.app.ActivityThread.main(ActivityThread.java:4745)
    E/AndroidRuntime( 1280): at java.lang.reflect.Method.invokeNative(Native Method)
    E/AndroidRuntime( 1280): at java.lang.reflect.Method.invoke(Method.java:511)
    E/AndroidRuntime( 1280): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    E/AndroidRuntime( 1280): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    E/AndroidRuntime( 1280): at dalvik.system.NativeStart.main(Native Method)
    E/AndroidRuntime( 1280): Caused by: java.lang.IllegalArgumentException: Unable to find native library: main
    E/AndroidRuntime( 1280): at android.app.NativeActivity.onCreate(NativeActivity.java:187)
    E/AndroidRuntime( 1280): at com.unity3d.player.UnityPlayerNativeActivity.onCreate(Unknown Source)
    E/AndroidRuntime( 1280): at com.android.AndroidNativeBridge.onCreate(AndroidNativeBridge.java:56)
    E/AndroidRuntime( 1280): at android.app.Activity.performCreate(Activity.java:5008)
    E/AndroidRuntime( 1280): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
    E/AndroidRuntime( 1280): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
    E/AndroidRuntime( 1280): ... 11 more
     
  14. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    126
    Hi to all,
    I have an issue...when i press submit score button and if i click on Load LeaderBoards ,a popup pops out with the leaderboard name and giving a value "-1"
    Please Help me i got struck up here....
    Thanks in advance


    Edit:i exported the example scene "google play services" and checked in my mobile phone and received the above mentioned result after clicking "Load LeaderBoards" button

    Edit:Everything worked well for score increment.solved by changing the leaderboard name in the ids.xml file.My leaderboard name is "Best run" but previously i have updated as "Bestrun" now i replaced with "Best run".How ever i have given the exact name("Best run") in the "PlayServiceExample.cs" file of example scenes.
    But after reaching the score 110(i.e., after pressing the submit score button 10 times)the score in leaderboard is showing only 110 even after several clicks on "Submit Score"button.
     
    Last edited: May 8, 2014
  15. seanbro

    seanbro

    Joined:
    Apr 25, 2013
    Posts:
    13
    I am unable to get GCM working correctly. I can register successfully and get the token, but when I send a test message to the device it crashes. I edited the AndroidManifest.xml file with my bundle id, but it still is not finding the GcmBroadcastReceiver. I am using the Facebook, Flurry, and Chartboost SDKs separately, would that be an issue? Do I need to do something with the bridge? Here is the ADB log:

    And the AndroidManifest.xml additions:
    Code (csharp):
    1.  
    2. <manifest ...>
    3.  
    4. <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    5. <permission android:name="com.mycompany.myapp.permission.C2D_MESSAGE" android:protectionLevel="signature" />
    6. <uses-permission android:name="com.mycompany.myapp.permission.C2D_MESSAGE" />
    7.  
    8. <application ...>
    9.  
    10.     <activity android:name="com.android.AndroidNativeBridge" android:label="@string/app_name".>
    11.         <intent-filter>
    12.             <action android:name="android.intent.action.MAIN" />
    13.             <category android:name="android.intent.category.LAUNCHER" />
    14.         </intent-filter>
    15.     </activity>
    16.  
    17.     <receiver android:name=".GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
    18.         <intent-filter>
    19.             <action android:name="com.google.android.c2dm.intent.RECEIVE" />
    20.             <category android:name="com.mycompany.myapp" />
    21.         </intent-filter>
    22.     </receiver>
    23.     <service android:name=".GcmIntentService" />
    24.  
    25.     <receiver android:name="com.google.android.gcm.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
    26.       <intent-filter>
    27.         <action android:name="com.google.android.c2dm.intent.RECEIVE" />
    28.         <category android:name="com.mycompany.myapp" />
    29.       </intent-filter>
    30.     </receiver>
    31.     <service android:name="com.google.android.gcm.GcmIntentService" />
    32.    
    33. </application>
    34.  
    35. </manifest>
    36.  
     
    Last edited: May 8, 2014
  16. spectra

    spectra

    Joined:
    May 6, 2014
    Posts:
    11
    The solution for your problem is quite simple:

    BUY the asset from assetstore, instead of using the pirated one. And ask to Stan for support.

    Yeah, I know exactly Android Native Plugin v3.1 that you use is non legal asset.

    Hope it can help solving your actual problem. :)
     
  17. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    126
    Excuse me Mr.Spectra!! i have purchased the plugin yesterday evening.And moreover i believe that all the forum members post their issues only after a successful purchase of plugin.And am not so good in finding the pirated plugins or illegal plugins.
    and also i have mailed to stan describing the above issue and got reply that he would be replying soon.
    Help if u can rather criticizing without knowing the facts.
    Anywaz a thanks alot for your response.Hope you can help me in solving issue
     
  18. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    126
    Will android native plugin allows to use Chartboost plugin???
     
  19. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    126

    Hi paala,Can u please explain elaborately (if u dont mind)about the procedure of importing the chartboost plugin(along with this Android native plugin) ,although detailed description was given in the chartboost website and despite of unsuccessful attempts, am asking this help buddy with this android native plugin???!!
    Thanks in advance!!!!!
     
  20. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Sorry guys for delay with answers.
    I been in vocation, but now I am back and will start to answer for questions.
    Small remark

    If you have urgent technical problem, please feel free to drop e-mail to the stans.assets@gmail.com - the support team will answer your question ASAP.

    Other question, feature requests, ideas, additional questions, plugins problems description - I would love to see it in this thread.
     
  21. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    I will but, it not popular request, so I can not give you time range when it will be implemented.

    Added to the plugin TODO list.

    I am working on multiplayer part. But basically i you want to do it your self, then you have play service implemented and play service connection, you need to implement multiplayer functions only.

    you can go like this:
    Code (csharp):
    1. GPAchievement achievement =  GooglePlayManager.instance.GetAchievementd(SUPER_ACHIVMENT_ID);
    2. if(achievement.state == GPAchievementState.STATE_UNLOCKED) {
    3. //SUPER_ACHIVMENT Unlocked
    4. }
    On it, thanks for the report

    Chartboost like any other plugin can be integrated with Android Native. And I believe in this thread there is solution for Chartboost
     
  22. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    There is no way to use plugin API directly with JS, but you can use any workaround when you need call C# API from JS, For example use
    C# script attached to game-object (with DontDestroyOnLoad) with will use plugin API, and call it function using SendMessage

    Will do, thanks for the note.

    Looks like something from with your manifest, please contact support team at stans.assets@gmail.com and provide full device log + your AndroidManifest.xml.
    Thnaks


    There isn't enough info to find out what is going wrong, I need to see the log. You sad you already contacted support team, is your problem already solved?

    As with any other plugin.
    And on this thread there is already was working solution.
    How ever I can not give straight forward instruction on how to integrate my plugin with any other. Because:
    1) I can not keep track of other plugins changes
    2) My plugins is also sometimes have pretty big changes and I do not know how it would affect other plugins
    3) Not all plugins have open source

    What can I do
    1) Provide open source Eclipse project with clean coding
    2) Give general instruction how to combine two plugins
    https://docs.google.com/document/d/...NYaCYTxXnn4eS4ytY/edit#heading=h.7frodoz468gu
     
  23. spectra

    spectra

    Joined:
    May 6, 2014
    Posts:
    11
    NO, I know for sure that you use pirated one. Don't even try to fool me. See for yourself on the ScreenShot below.

    $SS-Pirate.png

    The reason I don't update the latest version is : Time for everyone to purchase, purchase, and purchase. Stan's assets are awesome. It's well very worth every penny to spend on it.

    Hope it can help your actual problem. ;)
     
  24. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    126
    Ofcourse i have requested it,But i thought that thers no point in using a pirated plugin for which further technical support cannot be obtained and stan's assets are really wonderful which worths it .so ,i have purchased the plugin under the name anil@sruthika.net and lacost knows it well coz, Iam sending mails for the solutions/suggestions of the technical issues that I am facing it.
    And moreover i must thank u for tracking my posts all the way!!
    And iam about to receive the solution from stan, Befor that i am just trying to solve the issue by asking the fellow users!!!
    For further confirmation about my purchase of plugin u may ask stan!!!
    Hope we would post solutions/suggestions/alternates (an Helping hand required as alwaz) in our futher communication in this thread.
    I must Congratulate Stan for his tremendous effort for building such a Excellent plugin which worths buying of it!!
    Thanks Spectra for your support here in this thread!!!!
    Cheers!!!!...
     
  25. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,055
    Hi Lacost,

    i have your ios native, android native, google ads, google anayltics plugin. i use all in my multplatform game. i use windows standalone, windows store apps, windows phone 8, ios, mac os, web player platforms. there are few build problems. i can correct them but in next update of your plugins it will be overwritten by new files. can you check those plugins with platforms that i mentioned. new facebook sdk solved some of them. you should check it;

    https://developers.facebook.com/docs/unity/downloads/?campaign_id=282184128580929&placement=SDK_list
     
  26. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    126
    Please guys any1 from the forum reply to this post about the detatiled integration of chartboost plugin with android native plugin.
    I got fed up with n number of trails.Please suggest me and point me in right direction
    1. i tried extending the classes as described by stan in the help document but no use
    Please share the the new updated androidnative.jar file of Android native plugin 3.1 with the chartboost plugin integrated.
    As am damn poor in building android apps can any one explain how to import chartboost plugin with Android native plugin??
    Thanks a lot for the help!!!!
     
  27. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hello,

    spectra , sandeepsmartest
    I do really appreciate your kind words and support. Thanks a lot, and you can be sure I will continue to work on plugin, making it more stable, more feature right, and improve usability with every update. The new bug update will be submitted to the end of this weekends.

    Hi Lacost,

    Thanks a lot for the report I am really appreciate this.

    The working integration with Chartboost was on the older version of AndroidNative created by one of the customers.
    Unfortunately I do not have time now for integrating and testing Chartboost with the plugin.
    But I will try to create the tutorial of how to do this using past customers experience and share in in 1-2 days or so. I hope it will helps.
     
  28. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    126
    Lacost that was wonderful to have u here!!!! Again i must say u did a "awesome job" thanks for the Excellent support Lacost.Plz help me with this chartboost plugin integration with android native plugin...Hope u will give me the detailed procedure soon!!!!!!!!!!
    Excellent Work Lacost
     
  29. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    126
    Guys Please Help me!!!
    Facebook is not logging in,when try logging into my facebook account from unity it is working but when i make the apk of the FacebookExample.unity test scene it is not working on my mobile device.i am using Android Native Plugin v3.1.Please help me guyz.
    On a special note i have commented the line "#android.library=true" in the file "project" which is in the "\Assets\Plugins\Android\facebook" as it is throwing errors when iam trying to build apk .
    Thanks in advance!!
     
  30. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hello. Here is the small tutorial for Chartboost Integrations
    https://docs.google.com/document/d/...NYaCYTxXnn4eS4ytY/edit#heading=h.3gyvem5k8nc1

    Mostly, this is happened due to wrong hash key. Just feel free to send e-mail with problem description and logcat log to the support team at stans.assets@gmail.com

    Cheers!
     
  31. skullthug

    skullthug

    Joined:
    Oct 16, 2011
    Posts:
    175
    Hi lacost. This plug-in is great, thank you so much for writing it. It's incredibly useful.
    I have a question, I'm only using the plugin for IAP and cloud save on Android right now, but it keeps error nagging me saying
    Your Android setup is not correct. See Settings in Facebook menu.
    UnityEditor.HostView:OnGUI()

    I don't have any Facebook integration right now. Is there a way to stop this error from coming up?
     
  32. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hello. Sure you can simply add any app id into the Facebook settings or just remove the Facebook part.
    Cheers!
     
  33. electricpunch

    electricpunch

    Joined:
    Feb 18, 2014
    Posts:
    18
    Hi, lacost! I bought Android Native Plugin, but have a problem. I integrated in-app purchases in my game. When I run the game and go to purchase menu in my first scene, I'm trying to buy consumable item and all works well. But when I play the game (go to another scene) and then go to purchases menu, i have a bug: when I purchase the item I see 2-4 popup messages and the item purchases several times by one click. I don't know where is the problem, maybe because billing init called second time when I return to the first scene?
     
  34. skullthug

    skullthug

    Joined:
    Oct 16, 2011
    Posts:
    175
    Is there a dummy ID I can enter to disable it? Just entering 0 or jibberish numbers still generates the error.
    Is it as easy as deleting the Facebook folder and calling it done?

    BTW looking at the AndroidManifest.xml the warning comment says removing Facebook stuff might ruin Cloud Message.
    Code (csharp):
    1.  
    2.   <!-- VERY IMPORTANT! Don't forget this permission, or Cloud Message won't work. -->
    3.     <service android:name=".GcmIntentService" />
    4.     <activity android:name="com.facebook.LoginActivity" android:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation">
    5.     </activity>
    6.     <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 00" />
    7.     <activity android:name="com.facebook.unity.FBUnityLoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
    8.     </activity>
    9.     <activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true">
    10.     </activity>
    11.  
    But that exact same warning is elsewhere in the .xml on something that looks more relevant to Cloud Messaging. Is this just a typo?
     
  35. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hello, you didn't got double purchases, you simply got duplicated listeners, make sure you have added listeners only one time.
    you can actually watch some videos for more info.
    https://www.youtube.com/user/stansassets


    Yep that is a typo, will fix it, thanks for the report.


    Yep, just go to Facebook->Edit settings and enter something similar to "395891937214418"

    Cheers!
     
  36. Widji31

    Widji31

    Joined:
    Apr 18, 2013
    Posts:
    2
    Hi lacost ! I have got a little trouble to test Billing function on your BillingExample Scene for Android.
    I created a new apk in Google Developer console and i add new In-app Billing products for the apk. I replace the base64EncodedPublicKey in GPaymnetManagerExample with the one of my application.
    When i run the apk on an android Tab(from another account) and i click on « Test Succses Purchase » i’m always redirected to a sample product.
    I think i missed a basic step… How can i modify the function to test with the Billing products i created for this app?
     
  37. skullthug

    skullthug

    Joined:
    Oct 16, 2011
    Posts:
    175
    Sorry, but I'm afraid I'm still getting the error, even with that number or any gibberish entered.
     
  38. paala

    paala

    Joined:
    Mar 24, 2014
    Posts:
    17
    Hello,

    I atatched here the jar and xml file for ANDROID NATIVE v2.5 the one I use.

    If you want to use 3.1 or other i found the easiest way is to follow my procedure to combine chartboost and generate a JAR file, then , you need somehow to replace the Android native brigde class from the original JAR with the one you just created.
    See:
    http://stackoverflow.com/questions/4837500/how-can-i-edit-a-jar-file


    Stan doesn't provide instructions how to recreate the jar generated with eclipse, but my solution works.
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Now,

    Regarding Facebook posting, why in Ios we can post without app authentication , and in android we need permissions and all sort of things,
    Can we get Facebook posting in android without creating a facebook app?


    Thanks.
     

    Attached Files:

  39. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hello, if you will look at Test Succses Purchase button code you will see that it's trying to purchase test product
    Code (csharp):
    1.  
    2. AndroidInAppPurchaseManager.instance.purchase (GPaymnetManagerExample.ANDROID_TEST_PURCHASED);
    3.  
    What you need is to replace it with your product id
    Code (csharp):
    1.  
    2. AndroidInAppPurchaseManager.instance.purchase ("put your product id here");
    3.  

    This is Unity Facebook SDK error. It always was enough to set the app id. As I sad you can simply remove the Facebook part if you not using it. Just let me know if you need help with this.


    Well actually I already did :)
    How to compile androidnative.jar from eclipse project
    How to integrate Android Native with ChartBoost


    I may requires to use another api instead of Unity SDK. I will treat it as feature request

    Cheers!
     
  40. Bru345

    Bru345

    Joined:
    Apr 24, 2014
    Posts:
    2
    Is it possible to check if a achievement has been unlocked? If so, how would i go about doing it in code?

    Thank you
     
  41. Widji31

    Widji31

    Joined:
    Apr 18, 2013
    Posts:
    2
    It works perfectly!

    Thank you
     
  42. paala

    paala

    Joined:
    Mar 24, 2014
    Posts:
    17
    Hi Lacost,
    I didn't see you updated the doc, sorry.
    Regarding the facebook posting , yes could be a feature request. is just odd is different. And I think is better to just post than to request for permission and then post.

    Thanks
     
  43. ForceVFX

    ForceVFX

    Joined:
    Jan 21, 2011
    Posts:
    593
    Getting Unlocked Achievements--->>

    Code (csharp):
    1. private void OnAchivmentsLoaded(CEvent e) {
    2.  
    3.         GooglePlayManager.instance.removeEventListener (GooglePlayManager.ACHIEVEMENTS_LOADED, OnAchivmentsLoaded);
    4.  
    5.         GooglePlayResult result = e.data as GooglePlayResult;
    6.  
    7.         if(result.isSuccess) {
    8.  
    9. foreach(string achievementId in GooglePlayManager.instance.achievements.Keys) {
    10.  
    11.                 GPAchievement achievement = GooglePlayManager.instance.GetAchievementd(achievementId);
    12.  
    13.                 Debug.Log(achievement.id);
    14.  
    15.                 Debug.Log(achievement.name);
    16.  
    17.                 Debug.Log(achievement.description);
    18.  
    19.                 Debug.Log(achievement.type);
    20.  
    21.                 Debug.Log(achievement.state);
    22.  
    23.                 Debug.Log(achievement.currentSteps);
    24.  
    25.                 Debug.Log(achievement.totalSteps);
    26.  
    27.             }
    28.  
    29.             AndroidNative.showMessage ("OnAchivmentsLoaded", "Total Achivments: " + GooglePlayManager.instance.achievements.Count.ToString());
    30.  
    31.         } else {
    32.  
    33.             AndroidNative.showMessage ("OnAchivmentsLoaded error: ", result.message);
    34.  
    35.         }
    36.  
    37.     }
    This will loop through all your achievements and current data...


    p-
     
  44. electricpunch

    electricpunch

    Joined:
    Feb 18, 2014
    Posts:
    18
    Hi, lacost! I have a problem with Leader-bord integration. When I login with one account - all works well. But when I logout and login with second account - nothing happens. I click on button to show leaderbord and It's not showing. When I reload the game and click on button, I see selection account menu again. I downloaded random game with leader-bords from Google Play and in this game I successfully logged from both accounts.
    Please help me. Here is the code:

    Code (csharp):
    1.  
    2. void Start() {
    3.     GooglePlayConnection.instance.addEventListener (GooglePlayConnection.PLAYER_CONNECTED, OnPlayerConnected);
    4.     GooglePlayConnection.instance.addEventListener (GooglePlayConnection.PLAYER_DISCONNECTED, OnPlayerDisconnected);
    5. }
    6.  
    7. void OnClick() {
    8.     if (GooglePlayConnection.state != GPConnectionState.STATE_CONNECTED) {
    9.         GooglePlayConnection.instance.connect ();
    10.     } else {
    11.         OnPlayerConnected();
    12.     }
    13. }
    14.  
    15. private void OnPlayerConnected() {
    16.     if (PlayerPrefs.GetInt("Highscore",0) > 0)
    17.         GooglePlayManager.instance.submitScoreById ("CgkIx8Khs_kQEAIQAA", PlayerPrefs.GetInt("Highscore",0));
    18.     GooglePlayManager.instance.showLeaderBoardsUI("CgkIx8Khs_kQEAIQAA");
    19. }
    20.  
    21. private void OnPlayerDisconnected() {
    22.     GooglePlayConnection.instance.connect ();
    23. }
    24.  
    25. void OnDestroy() {
    26.     if(!GooglePlayConnection.IsDestroyed) {
    27.         GooglePlayConnection.instance.removeEventListener(GooglePlayConnection.PLAYER_CONNECTED, OnPlayerConnected);
    28.         GooglePlayConnection.instance.removeEventListener(GooglePlayConnection.PLAYER_DISCONNECTED, OnPlayerDisconnected);
    29.     }
    30. }
     
  45. tataragne

    tataragne

    Joined:
    Aug 15, 2009
    Posts:
    27
    Hello !

    Is it possible to unlock silently an achievement with your plugin ?
     
  46. Lumpizaver

    Lumpizaver

    Joined:
    Jun 25, 2013
    Posts:
    6
    Hey,

    I am using intents to share a screenshot from my game. If my manifest has this entry, whenever I get back from the intent into my game the game restarts.

    Code (csharp):
    1.  
    2. <activity android:name="com.android.AndroidNativeBridge" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:launchMode="singleTask" android:screenOrientation="landscape">
    3.     <intent-filter>
    4.         <action android:name="android.intent.action.MAIN" />
    5.         <category android:name="android.intent.category.LAUNCHER" />
    6.     </intent-filter>
    7.     <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    8. </activity>
    9.  
    If I write it like this:

    Code (csharp):
    1.  
    2. <activity android:label="@string/app_name" android:name="com.unity3d.player.UnityPlayerNativeActivity" android:screenOrientation="portrait" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
    3.     <intent-filter>
    4.         <action android:name="android.intent.action.MAIN" />
    5.         <category android:name="android.intent.category.LAUNCHER" />
    6.     </intent-filter>
    7.     <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
    8. </activity>
    9.  
    10. <activity android:name="com.android.AndroidNativeBridge" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:launchMode="singleTask" android:screenOrientation="landscape">
    11.     <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    12. </activity>
    13.  
    eveything works (for now).

    Will I have any troubles later on by removing the intent-filter from AndroidNativeBridge activity?
     
  47. nilton_felicio

    nilton_felicio

    Joined:
    May 17, 2012
    Posts:
    66
    I'm getting this error after update 3.2. Could you help me with this?
    Assets/PlayMaker/Actions/AndroidNativeActions/PlayService/PlayServiceShowLeaderboardssUIAction.cs(14,52): error CS1501: No overload for method `showLeaderBoardsUI' takes `1' arguments



    And congratulations for the excellent work, your addon is one of the most complete, great price, great integration with playmaker. 100%.
     
  48. paala

    paala

    Joined:
    Mar 24, 2014
    Posts:
    17
  49. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    Yeah i get the same error too, i had to rollback to previous version :(
     
  50. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Sure, will add this as option to Android Native

    There is no difference, on my side. I use Facebook SDK for IOS and Android. but will add native device api calls as option, as you see I already got such request :)


    Lumpizaver , AndroidNativeBridje should be main activity, there is no guarantees even now that all plugin function will work. But source code is open and you can feel free to change anything to feet your project needs.

    Sorry for kind words, and sorry for inconvenience guys.
    I will fix it today and will submit update.
    And if you do not want to wait until it got updated on Assets Store, simply feel free to drop e-mail to stans.assets@gmail.com tomorrow and request latest version (3.3)
     
unityunity