Search Unity

[Released] Android Native Plugin

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

  1. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    138
    Hi ,
    Same issue here.Someone in this thread has given a workaround i.e., try connecting to Google Play Services after a second or 2 using coroutine.
    To Stan Team: Please fix this issue as many people are facing this issue very badly.

    Hope this may help you.

    Nsks
     
    Last edited: Aug 10, 2015
  2. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Yes we mentioned issue number times in the thread, I did stress there is some problem with the plugin itself after upgrading to latest version but seems Stans support team not convinced. I think there is a bug but they cannot seem to find it yet. I did try the timing fix but again this does not work perfect as still certain odd behavior and instability. But this is Android for you, buggy as always! :)
     
  3. Dreamonaut

    Dreamonaut

    Joined:
    May 19, 2014
    Posts:
    32
    @sandeepsmartest @MrEsquire

    Thank you for the fast replies guys ! i'll try the workaround ! I hope Stan will be able to find this issue :).


    I had another issue with local Notification since i upgraded the plugin. You may got it too :

    Now everytime i send a notification i can see this error in the log cat and no localNotification are sent:

    i'm not using special string character , and this issue happens also with such small notification:
    androidNotificationManager.ScheduleLocalNotification("title","content",10);

    I think, i had this error because i generated notifications before updating the plugins. After updating it , i get this error whenever i load pending notifications. if i completely uninstall my app, all pendingnotifications are erased so i didn't get this error anymore. The newly generated notifications dont create issues when i loadpendingNotification.

    Anyone found a solution to this ? Thanks again.
     
    Last edited: Aug 10, 2015
  4. vtunity

    vtunity

    Joined:
    Aug 10, 2015
    Posts:
    2
    hey.
    I am haveing question about notification .
    is it possible to Schedule Notification at Every 5 hours .?

    AndroidNotificationManager.instance.ScheduleLocalNotification("Hello", "This is local notification", 5);
    it will show notification is only once after 5 second but after app close i want to Repeat notification at 5 hour interval .

    if its possible with android native then please suggest me a how to do it..!
     
  5. Dreamonaut

    Dreamonaut

    Joined:
    May 19, 2014
    Posts:
    32
    1 hours is : 60 * 60 seconds = 3600.
    so 5 hours is 3600 * 5 = 18000 seconds.

    so you would just do something like :

    function OnApplicationQuit() {
    AndroidNotificationManager.instance.ScheduleLocalNotification("Hello", "This is local notification", 18000);
    }
     
  6. akhil96

    akhil96

    Joined:
    Oct 12, 2014
    Posts:
    32
    what is the max limit for the number of seconds?
     
  7. Dreamonaut

    Dreamonaut

    Joined:
    May 19, 2014
    Posts:
    32
    I dont know but i already sent local notification with a timer that exceeded 24H and it worked.
     
  8. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416

    Yes I see the same thing.
     
  9. iwing

    iwing

    Joined:
    Sep 19, 2012
    Posts:
    1
    eclipse project source code is old version..
    Does not support anymore the source code updates?
     
  10. malyna

    malyna

    Joined:
    Jul 9, 2010
    Posts:
    105
    Hello,
    Is there a way to retrieve current progress of specific Quest?
    I think it is possible in Google Play unity plugin, If not, maybe I can implement it by myself?
    Thanks
     
  11. auzden

    auzden

    Joined:
    Nov 15, 2012
    Posts:
    5
    I'm still on Android Native 6.4 and am seeing similar results when connecting to Google Play. The 1-2 second delays I can live with, but at it's worst my game appears to be unresponsive for up to 45 seconds after a call to GooglePlayConnection.instance.connect(); - even if started as part of a Coroutine.

    At first the 45 seconds delay seemed to happen at random, but recently I was able to reproduce the problem reliably by clearing the data for the Google Play Services applications from Android's Settings menu and launching my game again.

    I'm still debugging the Android Native code, concentrating on the class GooglePlaySupportActivity. GooglePlaySupportActivity is declared as a "singleTask" in the Android Manifest.
     
    MrEsquire likes this.
  12. Dreamonaut

    Dreamonaut

    Joined:
    May 19, 2014
    Posts:
    32

    Do you think the issue could be in the manifest only ? ? The solution to use a delay through a coroutine at start did'nt work for me neither , the bug still happen randomly. I had to remove the autoconnect for now. If any of you find a solution, please let us know. ! ! ! ;)
     
  13. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Hi @Dreamonaut , I just updated from 6.7 to 6.8, and I get a issue by disappearing the Plugin Settings Tab, like this:

    *please can you help me, it's urgent...Thanks !
     
  14. auzden

    auzden

    Joined:
    Nov 15, 2012
    Posts:
    5
    I spent about a day looking at this and concluded that it's likely a Google Play Services problem after other non-Unity games behaved the same way.

    Like another user pointed out, you can press the Back button to dismiss Android Native's GooglePlaySupportActivity and return control to the Unity activity. However, this is a pretty bad user experience, especially if the problem occurs on the first run of your game.

    I ended up showing the loading spinner upon sign in to Google Play just so my game didn't appear to be frozen. I also added some analytics so I can track how bad this problem actually is in the wild.

    I considered changing Android Native's implementation to use GoogleApiClient.blockingConnect with a reasonable timeout value, but because Android Native is running connect on the main (UI) thread, I concluded that it was too risky to change with my game so close to release.
     
  15. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Same issue, it says for me cannot merge the two Android Manifests and build fails.
    Not sure but I try following these instructions and Stans and both times it didnt work out for me.
     
  16. Dreamonaut

    Dreamonaut

    Joined:
    May 19, 2014
    Posts:
    32

    To be honest i didn't updated to 6.8 yet ! ! i would suggest to do a fresh install ? ? Also, you should always do a backup of your whole project before updating, that's what i do ! ! Sorry !
     
  17. AlexStrook

    AlexStrook

    Joined:
    Oct 19, 2013
    Posts:
    31
    Hey guys !

    I'm using Android native plugin and I have a problem :

    When I use the Saved games functionnality, I can save without problems using the GooglePlaySavedGamesManager.instance.LoadAvailableSavedGames();

    And now the GooglePlaySavedGamesManager.instance.CreateNewSnapshot doesn't work anymore for me. I use the coroutine juste as in the example.
    With some debug I found that my code get stuck at the "CreateNewSnapshot " wich is in a coroutine, and the coroutine cannot get to step after...

    Do you know what could be the reason ? As I said it was working flawlessly before, but maybe I changed something by inadvertance...:)

    Thanks!
     
  18. tonyel4

    tonyel4

    Joined:
    Jul 4, 2013
    Posts:
    10
    I'm having the same problem after updating to 6.8. Anyone has found a solution to this problem?
     
  19. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Hey @tonyel4, I fixed the issue by @Dreamonaut suggested solution ;)
    Make a backup of your project then remove the ANP from project, after that reimport the ANP (clean fresh install).

    By the way, I'm not sure but in my case after I did that you will need manually rename somethings in code like from "instance" to "Instance" (capital "I") .

    Hope this will help you :)

    Have a nice day!
     
  20. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Hi guys, I'm trying to use OneSignal Push Notification & I get this error:
    MismatchSenderId, please double check your GCM Key and your Google project number in your app.
    PlayerID: cf13da30-45cc-11g5-b1c1-2b8dc291642f

    Why I get this ? Thx
     
  21. thomas_triplefun

    thomas_triplefun

    Joined:
    Sep 24, 2014
    Posts:
    25
    Hello,
    I would like to set an android theme different than default theme, for native popup (when i use AndroidMessage and AndroidDialog classes), have you got an issue ?

    Thanks :)
     
  22. jinhwan-ahn

    jinhwan-ahn

    Joined:
    Sep 24, 2012
    Posts:
    3
    I'm sorry I did not get good at English, but there are some questions Google-play services

    1. To log in and log out of the service after Google Play Is there a process that you can log in to another account? I was thinking it was not possible to test some of theGooglePlayConnection.Instance.disconnect () call or log back in when you log in again using this function look clearDefaultAccount(). I would appreciate known

    2. When you log in to Google-play services, for which registration is Google Play afterwards, to create a Google Play profile, in which case the login does not work correctly. When you exit the program and log in again well. If required, the profile has already been created.
    Is there something I know.What
     
  23. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    I am having the same problem: whenever i call Connect, the game freezes for a second or two and shows the status bar. In some devices i tested, this may even cause crashes. Other games with google play services enabled don't do this: They connect smoothly and without freezing the app briefly. The fact that the app freezes looks awful and unclean. Is there any way to connect to google play games smoothly and without that brief app freezing + status bar show?
     
  24. Rustamovich

    Rustamovich

    Joined:
    Sep 5, 2014
    Posts:
    36
    Hello guys!
    Created my first IAP, I have done everything by Tutorial video from Stan's team and when I'm trying to buy on my Android device a got this:


    On app loading I get message that login is ok.
    Maybe it is because my app in beta-testing? Where I was wrong?

    EDIT: Example stan's team app works fine
     
    Last edited: Aug 21, 2015
  25. LimboZone

    LimboZone

    Joined:
    Jun 17, 2015
    Posts:
    19

    have you added ur email to a group then add that group in an alpha test to test the purchases
     
  26. noethis

    noethis

    Joined:
    Nov 11, 2013
    Posts:
    129
    I'm using the Native Sharing service in order to share in-game screenshots on Twitter/etc. This was working just fine a couple weeks ago, but now I can't get it to post to Twitter any more. It properly opens up the tweet (starts the share intent) but when I hit "Post" nothing ever shows up on Twitter and it doesn't complain with any errors. Other things like Facebook work, just not Twitter. I don't think I've even changed anything related to it lately (other than updating to Unity 5.2). Even tried resetting my plugin settings.

    Anybody else seeing this issue?
     
  27. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,164
  28. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,164
    i import android native,google analytics,google mobile ads. i get following error;

    Assets/Extensions/StansAssetsCommon/FileStaticAPI.cs(9,21): error CS0101: The namespace `global::' already contains a definition for `FileStaticAPI'

    Assets/Extensions/StansAssetsCommon/Editor/SA_VersionsManager.cs(7,21): error CS0101: The namespace `global::' already contains a definition for `SA_VersionsManager'

    there is also FileStaticAPI 1 file. how can i solve this? do i have to delete one of them on each update?

    also native ios asset imports FileStaticAPI file as a new renamed file.
     
  29. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,164
    is it possible to add getDensity function to your unity API? i want to calculate banner size before it is loaded.
     
  30. Rustamovich

    Rustamovich

    Joined:
    Sep 5, 2014
    Posts:
    36
    Yes, I've done this
     
  31. pandamaster

    pandamaster

    Joined:
    Mar 2, 2015
    Posts:
    3
    Hi~

    "OneSignalSDK" Update please.

    I would like to use a "Group Key" features of OneSignal.

    Please tell me how fast update or replace SDK
     
  32. Huy Thach

    Huy Thach

    Joined:
    Mar 27, 2013
    Posts:
    6
    Is there anyone tried with Native Camera and Loading photo from Gallery in Other/OtherFeature scene?
    I am working in this issue, but there are some bugs:

    - Bug 1: The quality of photo taken from the camera is very low:
    Screenshot_2015-08-27-10-15-27.png

    - Bug 2: If we load the same photo from Gallery, the quality is better but the orientation is wrong
    Screenshot_2015-08-27-10-16-05.png

    - Bug 3: If we use the front camera to take photo, the orientation of the photo is also wrong.

    Screenshot_2015-08-27-10-16-33.png


    I have contact to Stan Team, but not reply yet.
     
  33. Zaryart

    Zaryart

    Joined:
    Jul 15, 2015
    Posts:
    3
    Hi! I had the same problem. You need to publish your alpha-testing apk. It's not publish you game, only alpha-testing for test accounts. I know that everywhere write without publication. I too have been looking for a solution to this problem. And in the morning I decided to test this theory and it worked :)
     
  34. Rustamovich

    Rustamovich

    Joined:
    Sep 5, 2014
    Posts:
    36
    My apk is published in beta-testing, so I need an Alpha? Which of three testing methods do you use? Closed beta-testing, Open beta-testing or beta-testing for google+ groups?
     
  35. anil_fa

    anil_fa

    Joined:
    May 29, 2015
    Posts:
    17
    Hey Stan,

    I am facing problem in push notification i am getting the push notification but i am unable to get the message in the notification bar...when i am using your plugin alone i mean without adding it into my project ..still the push notification using GCM is not showing message in notification bar...is the code is working properly...?? i am having issue here pleas help me out ..you asked me to send the data format which i have mailed you and i am even posting it here also ......

    // prep the bundle
    $msg = array
    (
    'message' => 'Get 1000 Gold Coins to Unlock Rex',

    'vibrate' => 1,
    'sound' => 1

    );

    $fields = array
    (
    'registration_ids' => $registrationIds,
    'data' => array("message" => $msg),
    );


    in the device the entire bundle and is getting printed as string in GoogleCloudMessageService.instance.lastMessage

    i am getting an output something like this:


    Message LoadedLast GCM Message: Bundle[{from=862082943136, message={"sound":1,"vibrate":1,"message":"Thank You for installing RaceRacer... Enjoy the Game in Android...!!!"}, android.support.content.wakelockid=1, collapse_key=do_not_collapse}]
     

    Attached Files:

  36. anil_fa

    anil_fa

    Joined:
    May 29, 2015
    Posts:
    17
    another pics
     

    Attached Files:

  37. wizard3d

    wizard3d

    Joined:
    Sep 30, 2014
    Posts:
    2
    Hello,

    I'm trying to use Android Native with Game Analytics plugin but there is a problem with the manifest merge.
    I found that I have to compile Android Native Plugin in Android Studio to extend from Game Analytics Plugin. Anyways, I imported Android Native Eclipse project to Android Studio but I'm getting this error, I cant figure out how to fixed.. I dont have experience in Android Develop.

    Error:(5, 5) uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library /Users/w3d/StudioProjects/AndroidNativeEclipce/AndroidNative/build/intermediates/exploded-aar/AndroidNativeEclipce/AN_Billing/unspecified/AndroidManifest.xml


    Thank you

    Lina
     
  38. EmreB05

    EmreB05

    Joined:
    Aug 9, 2015
    Posts:
    13
    Native bluetooth support?
     
  39. noethis

    noethis

    Joined:
    Nov 11, 2013
    Posts:
    129
    I'm using Network Info to check to see if the user has a network connection to know whether to wait for sign-in info to come back. However, it looks like this makes use of ACCESS_WIFI_STATE in stead of ACCESS_NETWORK_STATE.

    Does anybody know, will this mean if the user is connected via cellular network but not Wi-Fi, will it still return valid information when you call AndroidNativeUtility.instance.LoadNetworkInfo()?
     
  40. Rustamovich

    Rustamovich

    Joined:
    Sep 5, 2014
    Posts:
    36
    Hey guys! I've publish test game right into Google Play for all people, not alpha/beta channel, But I still get the same error during buying of something. Could someone help me?
     
  41. rafaellop

    rafaellop

    Joined:
    Feb 4, 2015
    Posts:
    26
    @Rustamovich You have to add a google account to the device where you test the app and it must not be the account you use as developer login in Google Play console. This will get rid of the errors, but to make test orders you need to additionaly add the google account to the alpha/beta testers emails in google play or a testers group (read on the Google Play documentation how to handle test orders).
     
  42. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150

    Nobody has a solution to this or even experienced this? I have Ultimate plugin too and experience it too. It connects correctly but freezes around a second or two while showing status bar (like if the game went to background or something).
     
  43. njwm

    njwm

    Joined:
    Apr 30, 2013
    Posts:
    26
    Hi,
    I have the same problem than you, here is what I did to fix it until they update the asset :
    "I found a solution to my freezing problem. I was calling this line GooglePlayConnection.instance.connect(); in the Start() function. So, I moved it in Update() and I call it after a delay of 200 ms and it works fine, no more freezing (Don't forget to have a flag to make sure you don't call the connect() every frame)."


    NSquared
    Sentinel (free) : https://play.google.com/store/apps/details?id=ca.nsquared.sentinel
     
    MrEsquire likes this.
  44. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Could the freeze be related to check if google play services is the latest version on the device?
    I just tried latest version and on a older Android phone, game loaded then froze for second then got a popup saying you need download latest Google play game services to run the game. But this did not happen on my Nexus pad 5.1.1
    I therefore think there is another bug present or I missed to include this popup..I keep checking as doing some speculation work.. Stans support team taking long time reply..
     
  45. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Can you share the code, so I can do simple copy and paste into my project to test this?
     
  46. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    To see if the Freeze issue goes I tried to do advanced sign in as per instruction here:
    https://unionassets.com/android-native-plugin/sign-in-132

    Code (CSharp):
    1. GooglePlayManager.ActionAvailableDeviceAccountsLoaded += ActionAvaliableDeviceAccountsLoaded;
    2.         GooglePlayManager.Instance.RetriveDeviceGoogleAccounts();
    3.         GooglePlayConnection.instance.connect (accountName);
    Gives me error, not sure if this still works
     
  47. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    You mean a timer in Update or a delay through a coroutine?
     
  48. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    Doesn't work with the timer. Still freezes and makes the game go background briefly (show status bar). Its so f**** annoying...
     
    MrEsquire likes this.
  49. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    Doesnt work with advanced signing either...And sometimes it just gets stuck. And if you minimize and maximize the game again it continues running and connects succesfully... so i learned that the game actually goes to background while connecting just like if you minimized it. Seriously i need help with this because it's annoying and no f*** game in the playstore that features PlayServices does this... they all connect smoothly and without freezings or to-background things...
     
    MrEsquire likes this.
  50. omniking

    omniking

    Joined:
    Apr 30, 2013
    Posts:
    3
    Hi, I got problem with connecting to google play service. It does show google play service image and after while nothing happen and return disconnect status. Trying to fix it for few days, still no luck. Google Developer all setup correctly.

    I already attach my log file here .
     

    Attached Files:

    • log.txt
      File size:
      852.5 KB
      Views:
      1,150