Search Unity

Prime31 Android Plugins Officially Live!

Discussion in 'Android' started by prime31, Jun 6, 2011.

  1. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @serious, how do you know it is a Int64? It's not documented yet by Google...
     
  2. serioustommy

    serioustommy

    Joined:
    Jun 12, 2012
    Posts:
    126
    I just printed out the type and looked at it in the log when running on the device.
    I understand that it's always risky to assume the type when it's undocumented so the safest way to convert would be to use Convert.ToString(dict["price_amount_micros"]) which handles all known primitive types.
     
  3. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @serious, have you figured out what price_amount_micros even is? I am getting a value of 0 for all my test apps even on the native side.
     
  4. Nitrohex

    Nitrohex

    Joined:
    Jan 16, 2013
    Posts:
    58
    @prime[31]

    Can you give me advice on which of your ads plugins can i implement in my Unity made Live Wallpaper, and ads will show in the Live Wallpaper and not on the settings page?

    Thanks
     
  5. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @nitro, I havent a clue. All of our ad plugins merely inject an ad view in the main layout. I don't know what you are doing with your layout so I can't say.
     
  6. serioustommy

    serioustommy

    Joined:
    Jun 12, 2012
    Posts:
    126
    It's supposed to be the number portion of the price (minus the tax), multiplied by 1 million (hence the micro). e.g. $1.99 will give you 1990000

    This is really helpful (for us at least) since our analytics requires currency and the amount to be logged separately.

    Not sure why it's returning 0 for you but it's working for me once I've fixed the conversion from long to string correctly in the plugin.
     
  7. Nitrohex

    Nitrohex

    Joined:
    Jan 16, 2013
    Posts:
    58
    Thanks for the response, i will try to figure out something.
     
  8. HolBol

    HolBol

    Joined:
    Feb 9, 2010
    Posts:
    2,887
    I'm still struggling to figure out how to get this working. I can seem to find a way to call a function to check whether something was purchased at all.
     
  9. Breakmachine

    Breakmachine

    Joined:
    Sep 19, 2009
    Posts:
    39
    Hi Prime

    We're having problems logging out of Facebook. It seems the sso session is not being closed when calling FacebookAndroid.logout().

    We've had the same problem with iOS Social Networking for quite a while I'm afraid.

    Could this have anything to do with your plugin or is Facebook to blame once again?
     
  10. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @break, I opened a bug report about that ages ago. Facebook closed it and said that it was the intended behavior to cache credentials. You can try opening a new bug report and perhaps you will have better luck.
     
  11. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
  12. AcZo NUT

    AcZo NUT

    Joined:
    Oct 17, 2013
    Posts:
    4
    Hi Prime

    I've problems with billing plugin. It show me " SendMessage: object GoogleIABManager not found!" on my debug log.

    I've try to re-import by delete the whole folder and import it again but notthing change.

    How can i fix it?
     
  13. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @aczo, that is not an error, that is nothing more than a log message. If you subscribe to any event the GoogleIABManager fires then the log will no longer occur.
     
  14. AcZo NUT

    AcZo NUT

    Joined:
    Oct 17, 2013
    Posts:
    4
    Hi Prime

    Thank you for reply. As you said that didn't an error and now I figured out what problems are.
     
  15. Breakmachine

    Breakmachine

    Joined:
    Sep 19, 2009
    Posts:
    39
    Last edited: Nov 25, 2013
  16. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @break, calling logout actually already calls closeAndClearTokenInformation but it will not work at all for SSO. SSO credentials are cached outside of the application.
     
  17. StevenSauer

    StevenSauer

    Joined:
    Mar 25, 2013
    Posts:
    19
    Heya Prime! Quick one here.

    How would I know if Game Services fails to start up due to the device not having the required software (Google+ or GooglePlay)? Is that in the authenticationFailed? If so, what is the exact error return?

    Our app got rejected on the Samsung store because the button did nothing when used on their test devices that only have the samsung specific store (of which we don't have any). We just need to know when the use of Game Services is completely unavailable.
     
  18. Breakmachine

    Breakmachine

    Joined:
    Sep 19, 2009
    Posts:
    39
    Hi again.

    Was implementing "apprequests" and it doesn't seem to work properly. I ran your demo-scene and login and reauthorization works fine. Share works but there's no callback. Show Post Dialog and Show Apprequests Dialog do not pop the dialog at all.

    ***SOLVED***

    There was a conflict with another plugin.
     
    Last edited: Nov 27, 2013
  19. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @steven, Google has dozens of failure methods. The best way to know the exact one they send is to replicate the environment and watch the logs while you have the *EventListener in the scene. It will dump the output of every single event that fires.
     
  20. dustinw

    dustinw

    Joined:
    Feb 11, 2013
    Posts:
    7
    Some of the Android plugins contain an outdated android-support-v4.jar file. This can cause the Cloud Messaging plugin to fail with apps crashing when a push notification is received from the server (older versions of this file don't contain a method you're calling to build the notification). Specifically if you import the Social Networking combo plugin after importing the Cloud Messaging plugin you will overwrite that file and break your app unknowingly.

    Please update all of your Android plugins with the latest version of android-support-v4.jar.

    Thanks.
     
  21. JChilton

    JChilton

    Joined:
    Jul 25, 2012
    Posts:
    21
    Hi Prime31;

    An issue ? with TwitterAndroid.

    After logging in, the string sent back via TwitterManager.loginSucceededEvent is not the actual @screen_name of a user, but rather the display name. This makes it impossible to pull down a user's profile information, as there is no exposed version of the iOS TwitterBinding.loggedInUsername I could use either.

    Any suggestions?

    edit:
    Also there is a discrepancy in the manifest for facebook,
    in manifest.xml it shows to add <meta-data android:name="com.prime31.FacebookPlugin" android:value="UnityPlayerActivityProxy"/>
    yet the documentation site facebook needs to be set to "com.prime31.UnityPlayerProxyActivity"

    Are these two different classes, or a typo altogether?
     
    Last edited: Nov 27, 2013
  22. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jchilton, once authenticated, you can use the Twitter REST API to get any information you want about the user. The meta-data declaration has nothing to do with any Activity or any Facebook setting.
     
  23. JChilton

    JChilton

    Joined:
    Jul 25, 2012
    Posts:
    21
    Correct, but I do not know what user is logged in, as the general way of getting a user information is to use 1.1/users/show.json?screen_name=xxxxxxx
    However, I do not have a screen_name or userid I can plug in there. On iOS the screen_name is passed back after login, as well as available via TwitterBinding.loggedInUsername. I wasn't able to find the twitter equivalent of facebook's /me

    -----

    edit:
    I found the equivlant of /me, it's 1.1/account/verify_credentials.json

    Plugins work great by the way, very easy to use.
     
    Last edited: Nov 27, 2013
  24. JChilton

    JChilton

    Joined:
    Jul 25, 2012
    Posts:
    21
    Prime31 : FacebookPlugin: openActiveSession.call with state: OPENING, exception: null

    I can never get facebook to progress past this.
    It will bring up the prompt to login, and then return to the app and nothing else will happen.
    I think it's a manifest issue, as I have QCAR as my main activity, but there's also inconsistencies with what should be in the android version of the manifest on multiple parts of the site / compared to the manifest.xml included in the plugin's package.

    http://pastebin.com/77mqruBn

    Facebook settings have PackageName set to com.qualcomm.QCARUnityPlayer and Class name set to com.prime31.FacebookProxyActivity
     
  25. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jchilton, QCAR overrides the main Activity and Facebook integration also requires that the main Activity be overridden. Check the General section of our Android docs for details.
     
  26. wmoscon

    wmoscon

    Joined:
    Dec 25, 2012
    Posts:
    5
  27. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @wmoscon, FileNotFound Exceptions indicate that the web server responded with a 4xx response code. That usually means you have an invalid access token or you did not request publish permissions.
     
  28. DARK_ETERNAL

    DARK_ETERNAL

    Joined:
    May 9, 2012
    Posts:
    41
    Greetings, @prime31

    After updating to the last Social Plugin, I've noticed a new entry in the manifest.

    <meta-data android:name="com.prime31.FacebookPlugin" android:value="UnityPlayerActivityProxy"/>

    It will work if my main activity is that of Unity. But I'm using an activity that overrides the UnityPlayerNativeActivity. What should be the 'android:value' parameter value? Guess this should be set for Flurry entry as well?

    Thanks in advance.
     
  29. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
  30. Plausch

    Plausch

    Joined:
    Nov 30, 2013
    Posts:
    2
    Hi @prime31

    I have a problem with the the Android Flurry plugin. The problem sound very similar to the problem that was reported from @sathya one week before.
    I call the onStartSession methode by the start of my application. And a report will be sent to the flurry server without problems. The Log show "FlurryDataSender: report 78*************e sent. HTTP response: 200 : OK"

    But my problem is the calling of the onEndSession methode . I call the methode from the Unity methode OnApplicationQuit(). But the data transfer will be never complet. The Logfile show only "Trying to end session" but this does not go further. I don't see "Ending session" or "FlurryDataSender: report 78*************e sent. HTTP response: 200 : OK" log.

    It look like that Unity will kill the process and the collected data will not be sent to Flurry server.

    What is wrong? Is there a better place to call the onEndSession methode?

    Thanks for your support.
     
  31. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @plausch, that is how the plugin works. When you app is quit data will not be sent until the next launch. Note that the comment above the onEndSession method reads as follows: "Ends your Flurry session. This is automatically called for you when your app is backgrounded so unless you have a good reason to call it you should never need to use it directly."
     
  32. JChilton

    JChilton

    Joined:
    Jul 25, 2012
    Posts:
    21
    I love the modularity of your helper jar, unfortunately it does not work with QCAR's packages, as there is a nasty DLLNotFoundException that pops up.

    I created an activity/native activity that extended QCAR's, then hooked each one to a ActivityProxyObjectHelper, and now all is working as intended.

    If it would be alright, I'd like to share my solution, as this is a commonly plagued question across both communities. My jar does not contain any of your source, as it calls the class indirectly. I had to package it as com.prime31 because the methods were protected however.
     
  33. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
  34. fcore7777

    fcore7777

    Joined:
    Dec 31, 2012
    Posts:
    5
    Hi,
    I found in comment for: EtceteraAndroid.promptForPictureFromAlbum
    // Prompts the user to choose an image from the photo album and resizes it to the dimensions passed in. Passing in 0 dimensions will get you a full sized image.

    where to pass in dimensions?
     
  35. DARK_ETERNAL

    DARK_ETERNAL

    Joined:
    May 9, 2012
    Posts:
    41
    Thanks for your reply, @prime31.

    If I understood, UnityPlayerProxyActivity should be the main activity, and in the line <meta-data android:name="com.yourpackage.yourclass" android:value="UnityPlayerActivityProxy"/>, the 'android:value' must always be the main activity?

    My line is this: <meta-data android:name="com.prime31.FacebookPlugin" android:value="BurstlyPluginActivity"/>; being 'BurstlyPluginActiviy' the main one. So, if I wanted to notify the FacebookPlugin with the activity lifeclycle through the BurstlyPluginActivity, that line would be correct, right? If so, this won't help me, and I'll get an exception stating that I attempted to open a session which is already pending for opening.

    It is a requirement to have the UnityPlayerProxyActivity as the main one? In my case, as I'm using SkyRocket's Burstly plugin (and, in order to get it work, their BurstlyPluginActivity must be the main one), I can't put the proxy activity as my main one. Perhaps I'm not understanding the syntax of the manifest line?

    Thanks in advance.

    UPDATE: Nevermind this. I totally forgot that Burstly plugin comes with another class for using with Prime31's plugins altogether. My mistake. Anyway, thanks for your support. Guess I should stick with Burstly first, before coming back to Prime with this issue
     
    Last edited: Dec 2, 2013
  36. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
  37. fcore7777

    fcore7777

    Joined:
    Dec 31, 2012
    Posts:
    5
    Hi Prime31,
    How I can pass size parameters into EtceteraAndroid.promptForPictureFromAlbum() ?
    thanks!
     
  38. Kid Canuck

    Kid Canuck

    Joined:
    Nov 29, 2012
    Posts:
    3
    I am updating the Prime31 Social Networking Android plugin. I can bring up the login dialog, and when I log in it tells me that I have already authorized the app, then I click OK and it returns to the game. It does show the following in the console:

    Code (csharp):
    1. I/Prime31 ( 1330): FacebookPlugin: openActiveSession.call with state: OPENING, exception: null.
    And there is some debate here as to whether this is an error or not. If the exception: null means that there was no exception, or if the exception was that something was null. Anyways, it does not bring up the app request dialog that it was supposed to, and if I tap the button again, I get an error:

    Code (csharp):
    1. I/Prime31 ( 1330): FacebookPlugin: openActiveSession.call with state: OPENING, exception: java.lang.UnsupportedOperationException: Session: an attempt was made to open a session that has a pending request.
    It seems from what I can gather that the session is not being updated from OPENING to OPENED when we return from the login dialog. It's not hitting any of the callback events either (neither sessionOpenedEvent nor loginFailedEvent).

    I have observed this behaviour within the test scene, using the Prime31 auto-generated AndroidManifest.xml file built using the tools.
     
  39. Dhaval Sarvaiya

    Dhaval Sarvaiya

    Joined:
    Jul 28, 2012
    Posts:
    9
    Hello,

    i have android game in which i am using Prime 31 plugins as follow,
    Chartboost (working fine)
    In app billing (Woriking fine)

    Tapjoy (was working fine) at the end of the day i have integrated the plugin was getting call back events and second day when i restarted the machine and unity i got the following error log in the log cat and was not getting the call back handler message or we can say events like successful awarded coins
    Errors i am getting is as follow which i think causing issue ,

    12-06 21:18:00.618: E/NativeActivity(8523): channel '41c39bf8 com.carla.coindozer/com.prime31.UnityPlayerNativeActivity (client)' ~ Failed to receive dispatch signal. status=-11
    12-06 21:18:00.658: I/InputReader(1987): dispatchTouch::touch event's action is 1 (deviceType=0) [pCnt=1, pending(waiting finished signal)=0]
    12-06 21:18:00.658: I/InputDispatcher(1987): Delivering touch to current input target: action: 1, channel ‘xxxx'
    ------------------------------------------>>>>>>>>>>>>>>>>>>>>>
    12-06 21:18:01.118: W/System.err(8523): java.lang.NullPointerException
    12-06 21:18:01.118: W/System.err(8523): at com.tapjoy.TJAdUnitView.getCloseBitmap(TJAdUnitVie w.java:283)
    12-06 21:18:01.118: W/System.err(8523): at com.tapjoy.TJAdUnitView.initUI(TJAdUnitView.java:2 51)
    12-06 21:18:01.118: W/System.err(8523): at com.tapjoy.TJAdUnitView.onCreate(TJAdUnitView.java :91)
    12-06 21:18:01.118: W/System.err(8523): at com.tapjoy.TJCOffersWebView.onCreate(TJCOffersWebV iew.java:23)
    12-06 21:18:01.118: W/System.err(8523): at android.app.Activity.performCreate(Activity.java:4 465)
    12-06 21:18:01.118: W/System.err(8523): at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1052)
    12-06 21:18:01.118: W/System.err(8523): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:1932)
    12-06 21:18:01.118: W/System.err(8523): at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:1993)
    12-06 21:18:01.118: W/System.err(8523): at android.app.ActivityThread.access$600(ActivityThre ad.java:127)
    12-06 21:18:01.118: W/System.err(8523): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1159)
    12-06 21:18:01.118: W/System.err(8523): at android.os.Handler.dispatchMessage(Handler.java:99 )
    12-06 21:18:01.118: W/System.err(8523): at android.os.Looper.loop(Looper.java:137)
    12-06 21:18:01.118: W/System.err(8523): at android.app.ActivityThread.main(ActivityThread.jav a:4507)
    12-06 21:18:01.118: W/System.err(8523): at java.lang.reflect.Method.invokeNative(Native Method)
    12-06 21:18:01.118: W/System.err(8523): at java.lang.reflect.Method.invoke(Method.java:511)
    12-06 21:18:01.118: W/System.err(8523): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:790)
    12-06 21:18:01.118: W/System.err(8523): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:557)
    12-06 21:18:01.123: W/System.err(8523): at dalvik.system.NativeStart.main(Native Method)
    12-06 21:18:01.128: D/WML_SISO(8523): InitPasteboardJni



    Also i have uploaded the detail log at this link http://hastebin.com/bolecololi.coffee

    Unity Version i am working on is 4.3.0f4

    Android Device i am using is Samsumg Galaxy s2 for testing Current Android OS version is 4.0.3

    Current Tapjoy plugin date is 2013-10-17
    "Problem is i am not getting the close button at when i press the test event at tapjoy offer wall , also not getting the call back messages and event successful messages "
    Thanks and Regards
     
  40. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @dhaval, Tapjoy is now closed source so based on the stack trace I can only guess that internally there is a resource issue with the close bitmap. You may want to try deleting all the Tapjoy resources then reimporting the plugin to ensure you don't have any old files in there.
     
  41. Dhaval Sarvaiya

    Dhaval Sarvaiya

    Joined:
    Jul 28, 2012
    Posts:
    9
    Actually i have tried that several times , like i have removed all the things completely.. also , i tried to on the fresh project, integrated the tap joy , but getting the same issue , what about the other issue "com.example.mygame/com.prime31.UnityPlayerNativeActivity (client)' ~ Failed to receive dispatch signal. status=-11 "
     
  42. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @dhaval, "Failed to receive dispatch signal" is an entirely normal log.
     
  43. zalogic

    zalogic

    Joined:
    Oct 6, 2010
    Posts:
    273
    Hey guys,

    Has anyone successfully used the Prime31 PlayGameServices plugin on Android 4.4 ?(http://prime31.com/docs#androidPlayGameServices)
    It works ok on all other Android OS versions but it freezes the app on Android 4.4 and I get the logs error quoted below.

    The weird part is that if I wait for the app to force-close and I try opening it again, PlayGameServices says Welcome UserXXX and it works. But the first time it when you login, it freezes. Also if you cancel the login, it freezes.
    Prime31, any feedback buddy? :)

     
  44. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @floky, as of now only one of my many test devices is on 4.4 and it works fine. The only oddity I see in that log is that the Play Activity seems to be trying to take a screenshot and it fails 4 times. There isn't much more information in there.
     
  45. zalogic

    zalogic

    Joined:
    Oct 6, 2010
    Posts:
    273
    Thanks for the confirmation. It's good enough for me. For now... :)
    Yeah, the screenshot logs are a weird thing from the OS not from my test app. It's like Android 4.4 is trying automatically to make a screenshot whenever an app crashes/freezes so it can prepare a crash report.
    The log offers too little info about this weird PlayGameServices freeze.

    I'll keep investigating and get back to you if I find something.
    Thanks again for the prompt feedback!
     
  46. claytoncurmi

    claytoncurmi

    Joined:
    Jul 6, 2010
    Posts:
    168
    Hi prime31

    I bought the Google Cloud Messaging plugin for Android. I've set up the Google Cloud Console as described in the docs and obtained the project number and API key. I've generated a new manifest (since I'm using other prime31 plugins) and build the demo scene. On my webserver, I've uploaded that sample .php and replaced the API key. The build launches successfully without any errors. I also manage to register successfully. However when I try to call the .php URL to send a message using the following format http://domain.com/GCMSample.php?id=<registrationId>, I get an Unauthorized exception 401 (not that replaced the script with a phpinfo() and it worked without errors from the same URL).

    What could be causing this issue? Moreover, if I want to integrate GCM with Urban Airship, what plugin do I have to use for Android? Is it the Etcetera like iOS?

    Thanks,
    Clayton
     
  47. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @clay, the demo PHP script is just meant to be a very rough tester and does not do any error checking at all. You will get a 4xx if any of the information is not correct including the API key or registration Ids.

    We have no plugins at this time for UA integration on Android. We are waiting patiently for UA to expose 2 missing endpoints on their REST API which we require for Android push support.
     
  48. claytoncurmi

    claytoncurmi

    Joined:
    Jul 6, 2010
    Posts:
    168
    Hi prime31,

    I've followed the instructions step by step as detailed here. I'm obtaining the API key from this screen

    $UrbanAirshipDemo.png

    I did the procedure as I mentioned in my previous post and I'm getting the 401 error. I googled around and based on the information provided here it seems that I've got the wrong API key. I'm running the following command on my server

    curl --header "Authorization: key=<API_KEY>" --header Content-Type:"application/json" https://android.googleapis.com/gcm/send -d "{\"registration_ids\":[\"ABC\"]}"

    and the response is the following;

    <HTML>
    <HEAD>
    <TITLE>Unauthorized</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
    <H1>Unauthorized</H1>
    <H2>Error 401</H2>
    </BODY>
    </HTML>


    The Google troubleshooting page specifies that "if you receive a 401 HTTP status code, your API key is not valid.".

    Could you please indicate what I'm doing wrong and what can I do to set up the GCM properly for my Unity Android app?

    Regards,
    Clayton
     
    Last edited: Dec 12, 2013
  49. claytoncurmi

    claytoncurmi

    Joined:
    Jul 6, 2010
    Posts:
    168
    Just to point out that I've also registered a web app and tried both the server and browser API keys. Both gave the same 401 error. Note also that I've set the Allowed IP addresses to Any IP address is allowed for now.
     
  50. claytoncurmi

    claytoncurmi

    Joined:
    Jul 6, 2010
    Posts:
    168
    Solved. I re-generated a server API key and updated that in the PHP script. Now it works. If you could include more information in the documentation regarding the server-side script, that would be better IMHO.

    Thanks,
    Clayton