Search Unity

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

Prime31 Android Plugins Officially Live!

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

  1. jesusluvsyooh

    jesusluvsyooh

    Joined:
    Jan 10, 2012
    Posts:
    377
    I've been using iAD for iOS and Admob for Andoird games, admobs has barely got me anything, 90% less ad revenue compared to iAD. And they've had roughly the same amount of downloads, so i'd say use another ad provider for Android, this is all in my opinion by the way ;)
     
  2. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    Android is a tough place to make money with ads. There really is no "best" provider. They will all get you pretty similar results.
     
  3. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    Getting this crash, any ideas?

    java.lang.RuntimeException: Unable to start activity ComponentInfo{bundleId/com.prime31.FacebookProxyActivity}: java.lang.IllegalArgumentException: activity cannot be null
     
    Last edited: Apr 10, 2013
  4. DARK_ETERNAL

    DARK_ETERNAL

    Joined:
    May 9, 2012
    Posts:
    41
    Greetings.

    I'm using the Flurry plugin, and I've found that no reports are sent to server. Looking into your documentation, I've found that I had to call the 'onEndSession()' function. But my question is, since I already opened the Flurry session on startup, but if I called this onEndSession in any other moment, should I call again the onStartSession?

    Thanks in advance.
     
  5. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @dark, you should call onStartSession anytime you want to start a gaming session and onEndSession anytime you want to end the session.
     
  6. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    Any idea on the error Prime?

    java.lang.RuntimeException: Unable to start activity ComponentInfo{bundleId/com.prime31.FacebookProxyActivity}: java.lang.IllegalArgumentException: activity cannot be null
     
  7. davhg

    davhg

    Joined:
    Apr 9, 2013
    Posts:
    9
    Hi

    How i can consumeProduct manual with product token in in-app billing plugin for android?
     
  8. hisashipong

    hisashipong

    Joined:
    May 5, 2012
    Posts:
    8
    I got some question in facebook plugin...

    i know fb now need request read permissions login first , before reauthorize with publish premissions
    and i have try the demo scene , if i click "Reauthorize with publish premissions" , it will crash directly
    "UnsupportedOperationException: Session: an attempt was made to request new permissions for a session that is not currently open."

    if i clicked "login" first and clicked "Reauthorize with publish premissions" , it won't crash

    in the above situation, my phone haven't install facebook app.

    but after install the facebook app, it will crash , whenever i click "login" or not , it will crash also when i click the "Reauthorize with publish premissions"


    Thank you so much , wait your reply~
     
  9. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @hisa, without logs there is absolutely nothing we can do to assist. All I can say is that a crash at that time almost always means an improperly setup Facebook app or improperly signed apk.
     
  10. davhg

    davhg

    Joined:
    Apr 9, 2013
    Posts:
    9
    @prime31, Hi

    How i can consumeProduct manual with product token in in-app billing plugin for android?
     
  11. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @davhg, below is a copy/paste directly from the documentation showing that the consumeProduct method takes a sku:

    // Sends out a request to consume the product
    public static void consumeProduct( string sku )
     
  12. davhg

    davhg

    Joined:
    Apr 9, 2013
    Posts:
    9
    No, in our project we need consumeProduct by token, not sku.
    After make payment product, we send some data to server, if server is available and return is success, than we need consume product with token from early payment product.
     
    Last edited: Apr 10, 2013
  13. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    Getting some crash reports from the Google Play Developer console, thus don't have steps to re-produce, but do have the crash reports. Any idea what's going on?

    java.lang.RuntimeException: Unable to start activity ComponentInfo{bundleId/com.prime31.FacebookProxyActivity}: java.lang.IllegalArgumentException: activity cannot be null
    at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:1956)
    at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:1981)
    at android.app.ActivityThread.access$600(ActivityThre ad.java:123)
    at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1147)
    at android.os.Handler.dispatchMessage(Handler.java:99 )
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.jav a:4427)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:795)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:562)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.IllegalArgumentException: activity cannot be null
    at com.facebook.UiLifecycleHelper.<init>(UiLifecycleH elper.java:53)
    at com.prime31.FacebookPlugin.createUiHelper(Facebook Plugin.java:40)
    at com.prime31.FacebookPlugin.<init>(FacebookPlugin.j ava:32)
    at com.prime31.FacebookPluginBase.instance(FacebookPl uginBase.java:2
    at com.prime31.FacebookProxyActivity.openSession(Face bookProxyActivity.java:62)
    at com.prime31.FacebookProxyActivity.onCreate(Faceboo kProxyActivity.java:41)
    at android.app.Activity.performCreate(Activity.java:4 465)
    at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1049)
    at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:1920)
    ... 11 more

    P.S. I replaced the bundleId with "bundleId" for privacy reasons.
     
  14. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @poolts, we require steps to reproduce in order to look into this. There are far too many hacked Android OS ROMs, budget hardware with insufficient RAM and general Android hacks for us to look into every report that ends up the Play console.
     
  15. eezSZI

    eezSZI

    Joined:
    Nov 16, 2012
    Posts:
    121
    When we enter a blank string "" for the toAddress parameter in showEmailComposer we are getting a comma (,) in the To field rather than leaving that blank. It also shows a comma if we pass in a space " " and null just fails.

    Is there a way to have no default address in the TO field of the composer on Android? It seems to work fine for Etcetera iOS.

    Thanks!

    ex:
    EtceteraAndroid.showEmailComposer("", "Our subject", "Our signature", false, pngLoc);


    http://prime31.com/support/312/how-do-you-leave-the-toaddress-blank-android-email-composer
     
  16. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @eez, the email composer requires a to address.
     
  17. eezSZI

    eezSZI

    Joined:
    Nov 16, 2012
    Posts:
    121
    Are you saying the android OS has no way to open the mail composer without the "to" field being supplied? And if you dont supply it they put in a comma instead?
     
  18. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @eez, the plugin currently requires a to address
     
  19. eezSZI

    eezSZI

    Joined:
    Nov 16, 2012
    Posts:
    121
    Ok. I'll add in my feature request then. :) Seems like it would be handy if anyone ever has something like "Email this to friend", you wouldnt want to fill out the "to" field for them. If only the source code was editable...

    --

    As far as I can find, if you don't add recipients to the intent it shouldn't show them. Something like:

    if(recipients != null)
    emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, recipients);

    Thanks for all the great products!
     
  20. Byrondinho

    Byrondinho

    Joined:
    Jul 26, 2011
    Posts:
    19
    Hi prime31,
    My game reporting this error so many times with iap google. Some suggestion?

     
  21. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @byron, we require steps to reproduce in order to look into this. There are far too many hacked Android OS ROMs, budget hardware with insufficient RAM and general Android hacks for us to look into every report that ends up the Play console.
     
  22. TorresL

    TorresL

    Joined:
    Apr 12, 2013
    Posts:
    1
    @prime31 hi
    Does Etcetera Plugin - Android can handle video record with vuforia(showing model on ar detection) ? Thanks.
     
  23. serioustommy

    serioustommy

    Joined:
    Jun 12, 2012
    Posts:
    126
  24. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @serious, there are no plans at this time.
     
  25. Gonemad

    Gonemad

    Joined:
    Mar 20, 2013
    Posts:
    15
    Hi Prime,

    I've been playing with the Etcetera Android plugin "e-mail" feature, but I'm unable to send the body in HTML format even though the "isHTML" parameter is set to true. I'm running the Etcetera demo app on a Nook. I frequently receive emails with embedded links, so I'm sure my Outlook is configured correctly. Any ideas?
     
  26. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gonemad, not all email programs support HTML. Test on a non-modified Android branch (any non-Nook device) and the default email program will accept HTML without issue.
     
  27. x-stuff

    x-stuff

    Joined:
    Apr 18, 2013
    Posts:
    7
    Hi prime
    my apologize for my bad English in advance..

    I have upgrade IABPlugin to v3.
    And now i get problem. I can't test in-apps with andriod.test.purchased sku.

    First of all i tried on application that already published in google play, my application has same version and version code, and signed. And google account on device is test account in developer console

    and GoogleIAB.queryInventory() skus[] contains "andriod.test.purchased" sku

    I try to
    Code (csharp):
    1. GoogleIAB.purchaseProduct("android.test.purchased");
    but google play respond to me "error: item not found"
    log cat:
    Code (csharp):
    1. 04-18 16:57:01.370: E/Volley(7844): [317] BasicNetwork.performRequest: Unexpected response code 500 for https://android.clients.google.com/fdfe/details?doc=subs:com.xxxx.yyyy:android.test.purchased
    2.  
    then tried not signed application - the same
    then tried new project (new application) and just build IABTestScene
    same problem

    I have noticed that url
    Code (csharp):
    1. https://android.clients.google.com/fdfe/details?doc=subs:com.xxxx.yyyy:android.test.purchased
    to google play has doc=subs, does it tries to get subscription named "android.test.purchased" ?

    and if i try to purchase in-app item that has published - google play respond normally and show me purchasing screen

    Please help.
     
    Last edited: Apr 18, 2013
  28. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @x-stuff, the test products are not currently supported. You can use a test user and your real products for testing.
     
  29. x-stuff

    x-stuff

    Joined:
    Apr 18, 2013
    Posts:
    7
  30. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @x-stuff, not supported by the plugin. We have extra checks and balances that require actual products at this time.
     
  31. Gonemad

    Gonemad

    Joined:
    Mar 20, 2013
    Posts:
    15
    Hi Prime, I also ran the Etcetera demo app on the Google Nexus (non-modified Android branch) with the same result - the email body lost the HTML format. I used a couple of different mail clients on the Nexus and none of the emails had embedded links. It's an important feature for us and the reason we bought the Etcetera plugin. Any further insight is very much appreciated. Thanks in advance.
     
  32. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gonemad, then open a bug report with Google. Obviously there is nothing we can do to change how their email app works. The plugin can do nothing more than send the Intent and tell the Intent receiver that the content is HTML.
     
  33. Gonemad

    Gonemad

    Joined:
    Mar 20, 2013
    Posts:
    15
    Sure, I can open a bug with Google. Can you tell me the types of Android devices you used to test the HTML functionality? Thanks.
     
  34. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gonemad, we have about 15 devices from various manufacturers running various OS versions: LG, Samsung, Google, ASUS, Amazon running from 2.3 to the latest
     
  35. RobGreen

    RobGreen

    Joined:
    Oct 9, 2012
    Posts:
    7
    We've been getting a lot of reports of the following:

    Code (csharp):
    1. java.lang.NullPointerException
    2. at com.prime31.util.IabHelper.queryPurchases(IabHelper.java:999)
    3. at com.prime31.util.IabHelper.queryInventory(IabHelper.java:637)
    4. at com.prime31.util.IabHelper.queryInventory(IabHelper.java:611)
    5. at com.prime31.util.IabHelper$2.run(IabHelper.java:721)
    6. at java.lang.Thread.run(Thread.java:856)
    It took me a while to reproduce it, then all of a sudden I managed to get it in the middle of a game level, far away from where I expected to be querying purchases. Here's what I think happens:
    The device is running very low on memory, so it shuts down every process it can. Multiple times in the log I can see lines like this:
    Code (csharp):
    1. Process com.android.vending (pid 2160) has died
    2. Scheduling restart of crashed service com.android.vending/com.google.android.finsky.billing.iap.InAppBillingService
    At some point shortly after, the billing service is recreated, and the IAB plugin fires the billingSupportedEvent, after which we were querying the inventory, and that's when we see the error above.

    Obviously something we can do to help this is to avoid querying the inventory more than once per session, but this won't stop it from crashing if the billing process were to die between the time the IAB code is initialised and the first time the inventory is queried. In this situation, it seems like whatever it being called in IabHelper.java:999 can be NULL, even if this could never happen during normal operation.
    This is running stock android on a nexus one BTW, though I've also seen it on a nexus 7. So I'm sure it's not a result of unusual custom roms or dodgy store hacks or anything like that.
     
  36. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @rob, we require steps to reproduce in order to look into this. There are far too many hacked Android OS ROMs, budget hardware with insufficient RAM and general Android hacks for us to look into every report that ends up the Play console.
     
  37. RobGreen

    RobGreen

    Joined:
    Oct 9, 2012
    Posts:
    7
    Yes, that's why I made sure to note at the end that this does not require any custom roms or crappy hardware or hacks of any nature.

    If my hypothesis is right, it would likely be impossible to reproduce in a demo scene on a recently rebooted phone. Instead you'd have to either load up lots of other apps or modify the demo scene to allocate large quantities of memory.
     
    Last edited: Apr 19, 2013
  38. Martin_Gonzalez

    Martin_Gonzalez

    Joined:
    Mar 25, 2012
    Posts:
    361
    @prime31 Hi! I'm using Social Network (Twitter) without problem but i have several question with Facebook)

    How can i know when is really log in? (I know, you are thinking in isSessionValid() ) but, Always talking in your demo (with a label showing a bool equal to isSessionValid). I push Facebook init button (nothing happens, bool is false),
    *push login, facebook login appears, and permision too.(bool kepps false)
    *push getsessiontoken (nothing happens) read only
    *get granted permisions (nothing happens) read only
    *post image (nothing happens) check out on facebook and the image is not there
    *post message (the same as image)
    *post message and extra (the same)
    *Show Dialog (appears again login part when i have already log before) but this works BUT when i go to facebook page the post is visible only for me "Only Me" it would be great to be public How can i change this?

    I know that are lots of questions but the only thing i want is to have a :
    bool with return true when is logged, (this dont work)
    posibility to post automatically (this dont work)
    Show dialog so user can write something (this work)
    I remember you, im with the Facebook Scene Demo.

    Thank you!
     
  39. Peng Peng

    Peng Peng

    Joined:
    Mar 5, 2013
    Posts:
    2
    @prime31

    Last week, I added Prime31 Android Flurry Plugin in my unity project.
    It is very easy to use. The only question is that the "New User" numbers in Flurry Dashboard is only 1/3 of those in my Google Play Console

    below is my code

    function OnApplicationPause( pause : boolean ) {
    #if UNITY_ANDROID
    if( pause ) {
    FlurryAndroid.onEndSession();
    } else {
    FlurryAndroid.onStartSession( "something", true, true );
    }
    #endif
    }

    can anyone give me some help?
     
  40. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @peng, Flurry data is usually ~48 hours behind
     
  41. Breakmachine

    Breakmachine

    Joined:
    Sep 19, 2009
    Posts:
    39
    Does your Android Etcetera plugin support push notifications (GCM)?
     
  42. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @break, no
     
  43. Gonemad

    Gonemad

    Joined:
    Mar 20, 2013
    Posts:
    15
    Hi Prime, running your Etcetera Android demo, I'm getting the ActivityNotFound exception when accessing the "Show Web View" button. The error message is as follows:

    android.content.ActivityNotFoundException: Unable to find explicit activity class {com.company.project/com.prime31.WebViewActivity}; have you declared this activity in your AndroidManifest.xml?

    The "Show Inline Web View" works fine. Any ideas?
     
  44. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gonemad, that would indicate that you did not run the Generate AndroidManifest menu item to create a proper manifest file.
     
  45. Gonemad

    Gonemad

    Joined:
    Mar 20, 2013
    Posts:
    15
    Damn, prime, you're a genius!

    One more question. The Web View navigates to a server that redirects to another page. Is there a way to get the redirected URL from the plugin? Your thoughts are appreciated. Thanks.
     
  46. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gonemad, there is no way. Unity is inactive when the webview Activity is showing.
     
  47. Gonemad

    Gonemad

    Joined:
    Mar 20, 2013
    Posts:
    15
    Yeah, I totally understand for the stand-alone WebView. But, Unity seems to be working in the background for the In-Line WebView. Would it be possible to get the URL/payload from that? Thanks again.
     
  48. BonPlus

    BonPlus

    Joined:
    Apr 29, 2013
    Posts:
    4
    Hi!
    I'm using the social networking plugin for my game, which is working great so far. However, I noticed something on the documentation:
    TwitterAndroidManager doesn't fire a "postSucceeded" event like the iOS version. Is there some way to know if the twitter post was successful in Android?
     
  49. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @bon, see the requestSucceededEvent
     
  50. BonPlus

    BonPlus

    Joined:
    Apr 29, 2013
    Posts:
    4
    But wouldn't that fire with -any- successful request? Will it fire at the same time as loginDidSucceedEvent, for example?