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
    @rbisso, that is how Googles billing system works. There is no such thing as a consumable vs a non-consumable product. You have to manage it yourself.
     
  2. rbisso

    rbisso

    Joined:
    Jul 13, 2011
    Posts:
    29
    @prime31 You do not have to consume an item before buying a new instance of that same item, in the case that you want to keep multiple quantities of that item. Your plugin is stopping me from buying the same item multiple times right now, even though that item is marked as "unmanaged". This was not previously the case and, right now, it's breaking our game.

    From Google's documentation:

    "Non-consumable and Consumable In-app Products

    It's up to you to decide if you want to handle your in-app products as non-consumable or consumable items.

    Non-consumable Items

    Typically, you would not implement consumption for in-app products that can only be purchased once in your application and provide a permanent benefit. Once purchased, these items will be permanently associated to the user's Google account. An example of a non-consumable in-app product is a premium upgrade or a level pack.

    Consumable items

    In contrast, you can implement consumption for items that can be made available for purchase multiple times. Typically, these items provide certain temporary effects. For example, the user's in-game character might gain life points or gain extra gold coins in their inventory. Dispensing the benefits or effects of the purchased item in your application is called provisioning the in-app product. You are responsible for controlling and tracking how in-app products are provisioned to the users.

    Important: Before provisioning the consumable in-app product in your application, you must send a consumption request to Google Play and receive a successful response indicating that the consumption was recorded."

    http://developer.android.com/google/play/billing/api.html#consumetypes
     
  3. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @rbisso, it appears that you did not read far enough along in the documentation you linked to. The next section entitled "Managing consumable purchases in your application" quite clearly states in number 3: "If the purchase was successful, consume the purchase by making a consumePurchase call."

    You absolutely cannot purchase an item twice with Google's billing system until it is consumed. That is an undeniable fact.
     
  4. rbisso

    rbisso

    Joined:
    Jul 13, 2011
    Posts:
    29
    So, why did you say:

    Why couldn't you just say that consumables must be consumed? Why tell me there is no such thing as a consumable vs a non-cosumable product?

    Your customer support is by far the worst of any of the plugins we've ever bought. Spend less time belittling your customers and more time making their lives easier. If you can't manage it yourself, hire someone to do it for you. If you can't afford it, here's a tip: never include the phrase "It's pretty clear" in your responses. It's ridiculously condescending and essentially amounts to 'RTFM'. This is not your favorite Internet battleground, it is a support thread. Like it or not, you are a service... and you guys are developing a terrible reputation amongst your customers. You should consider rehabilitating it, as it is injuring your business. I'd never recommend your plugins to anyone, just on the basis of the lack of respect shown to your users.
     
  5. rbisso

    rbisso

    Joined:
    Jul 13, 2011
    Posts:
    29
    Also, why not include a simple upgrade guide when you make major changes to a plugin? You guys changed in Android IAB a lot post 4.2 (changing method names, etc, for whatever reason) and we're forced to dig into all that ourselves. You guys really need to get better at communicating with your users. The services you provide are really helpful, but why not seal the deal by providing great support? Not to seem overly harsh, just trying to help you guys (and others who use your products) out.
     
  6. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @rbisso, there are no consumable vs non-consumable products in Google's billing system. They contain nothing other than Managed products. They dropped unmanaged products about a year ago.

    It isnt our job to educate you on how the entire Google billing system works. We are not a "service provider", we provide software. Nowhere in any of our literature does it say that we are required to even provide support at all. If you asked Google to explain how their billing system worked would you expect to get a response? We provide a plugin that gives you incredibly easy access to the underlying system. We support any and all issues with our code nearly instantly. Literally thousands of lines of code are reduced to just a few. If that isnt making your life easier I'm not sure what is. In addition, no knowledge of Android OS, Java, JNI, networking, managed-to-managed calls, etc is required to use the plugin. It is still the developers responsibility to at least have a cursory understanding of the way the billing system works. For the super low price we charge we just cant take the time to teach each and every person how the underlying system operates. Google wrote some excellent documentation that is there to do that job. You really do have to RTFM just a little bit.
     
  7. rbisso

    rbisso

    Joined:
    Jul 13, 2011
    Posts:
    29
    100 person teams of people work for two years on well-supported games that cost the same "super low" $60 you charge for this plugin. Before you get on about how few of them you sell, consider that you might sell more by providing, at the very least, non-confrontational, non-insulting support. And maybe some ongoing documentation that's more than the bare-bones. Clearly, what you're doing is not working, if you have a 100-page thread of questions/complaints for just your Android plugins.

    Even if you have contempt for your users, you could at least try to hide it for the sake of your business.
     
  8. rbisso

    rbisso

    Joined:
    Jul 13, 2011
    Posts:
    29
    Alright, we worked out the issue offline. prime31 is just a little terse in his responses because he's got a lot to handle. No insult is intended. Fact of the matter is, what he provides is a great product that gets us a long way toward having great games, it's just a little short on docs and guides. I wish there were a place we, as users, could get together and further flesh out the documentation, make upgrade guides, etc etc. Fact is that this stuff can be pretty intimidating, even for someone who kind of knows what they are doing. I'd hate to be a rookie dev trying to implement this stuff.
     
  9. alewinn

    alewinn

    Joined:
    Nov 8, 2009
    Posts:
    185
    Hello Prime !

    We are using the new Prime31 Google Play Game pluggin (iOS version for now).
    It's a great pluggin, very powerfull, Google play functionalities are great !

    Prime, can you just automate with the Postprocess script for :
    https://developers.google.com/+/mobile/ios/getting-started
    Specially for
    Step 4. Add a URL type
    by adding insidethe Identifier / Url Scheme the Bundle identifier of the unity game
    Please :)

    On the other hand, I hade a correct authentication / redirection inside the game from Safari on the device, but the game don't seems to receive events (authenticationSucceeded / Failed)

    Do you have some suggestions about this ?


    Thanks !
     
  10. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @alewinn, it's already there. Here is a snippet from our docs:

    "Once the setup is complete in the Developer Console you will need to launch the "Info.plist additions..." menu item from the prime[31] menu. a URL scheme must be added that matches your bundle identifier exactly. The GPGApplicationID must also be entered exactly as it appears in the Developer Console."
     
  11. Imran Khalil

    Imran Khalil

    Joined:
    Feb 6, 2013
    Posts:
    4
    When I call the function FacebookAndroid.init (), it returns the following error: Failed to find provider info for com.facebook.katana.provider.AttributionIdProvider .

    In the facebook page is now all set: Package Name, Class Name and Key Hashes.

    Also manifest in:
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 00000000000"/>
    <activity android:name="com.prime31.FacebookProxyActivity"/>
    <activity android:name="com.facebook.LoginActivity"/>
    <uses-permission android:name="android.permission.INTERNET"/>

    Its working on some device and in some i am getting the error.
     
  12. alewinn

    alewinn

    Joined:
    Nov 8, 2009
    Posts:
    185
    Prime, you rock and all of yours are blessed.
    ... I was blind but now my application builds automatically without intervention of humble man's han.
    Amen
     
  13. alewinn

    alewinn

    Joined:
    Nov 8, 2009
    Posts:
    185
    ... But still can't receive messages from Xcode (Authenticationsucced/failed..Etc...)
    I replicated your sample project, calls to PlayGameServices.init(..) / PlayGameServices.Authenticate() / etc... methods seems to work properly, but can't receive messages from the bridge...

    Do you have any clue ? Do I have to create the "EventListener" game object in the first scene ? Is there some naming convention for the event receiver gameobject ?
     
  14. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @alewin, have you tried the demo scene? It will automatically log every event to the console and is a great way to see when the events are firing.
     
  15. alewinn

    alewinn

    Joined:
    Nov 8, 2009
    Posts:
    185
    @Prime ; yup sure.

    I used our Google Game ID config with the demo scene, but same problem, it gets inside Safary, then authorise, then go back inside the game, but it dont receive events :s (No trace inside the log).
    I'm trying to have an access to the Google console (I'm not the owner of the application) there should be something missing inside the backend...
     
  16. alewinn

    alewinn

    Joined:
    Nov 8, 2009
    Posts:
    185
    ... Checked the console, oAuth is ok (checked)... don't understand why the application can't receive messages from Xcode !
    Please help !
     
  17. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @alewinn, have you tried it in an empty Unity project? It is possible that you have other code overriding the openURL: app delegate method which would prevent any auth events from occurring.
     
  18. alewinn

    alewinn

    Joined:
    Nov 8, 2009
    Posts:
    185
    .. It works absolutely fine inside an Empty unity project, but when I come to include it inside our project (which encloses various Xcode plugins), the demo don't work anymore. It builds ok, but same problem, the event receiver seems to not work correctly...

    Do the Google Play game addon uses some kind of JSon library ?
     
    Last edited: Jun 21, 2013
  19. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    I can't say for sure what Google uses as they are still closed source for the library. It has to have some kind of JSON lib though since their REST API returns JSON.
     
  20. TheRaider

    TheRaider

    Joined:
    Dec 5, 2010
    Posts:
    2,250
    I feel fairly lost and the documentation on the prime31 site hasn't helped, nor the example scene.

    All I want is for the user to be able to buy the full game as an IAP. Please help since it is all I need to do to be able to release :)
     
  21. luis1992

    luis1992

    Joined:
    Mar 25, 2013
    Posts:
    7
    Hi prime. I have some problem when posing the score. I read a lot and I know the flow is basically :
    1, login
    2. get app access token << I got an error here :
    Something went wrong deserializing the json. We got a null return. Here is the json we tried to deserialize: access_token=198679586956870|fSSY8ejZt_Bx6yw3HXNZAZSOWMY
    I passed the appid and appSecret and a string handler as arguments

    so, i try to copy this string and set it as the appaccess token
    3.Call postScore() with my actually id, score and an hanndler with contain a bool.

    However it just doesn't work. Before I read the this thread and the facebook score API page, I used the access token in my test app and it worked.( yea thats true, I don't know why) But it just suddently stopped working when I create a new app but with the same method.
    Please help me to find out the error, I was so close. Thank you.
     
  22. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @luis, it sounds like your Facebook app might not be setup as a game. Facebook will not allow score posting unless the app is setup as an actual game in the app settings.
     
  23. luis1992

    luis1992

    Joined:
    Mar 25, 2013
    Posts:
    7
    @prime
    Thanks for the reply. I just sorted out. Basically, I got all things working fine, except I forgot to get the permission to post.
    BTW posting score can use either a user or app access_token according to the facebook api page.
    Thats why i can get it work with user access_token.
    I still want to know what happen to the access token that I got??
    Why is it telling that "Something went wrong deserializing the json"
     
  24. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @luis, that is normal. Getting the token is the only API that does not return JSON for some reason so that log will be shown.
     
  25. LuisGuimaraes

    LuisGuimaraes

    Joined:
    Oct 9, 2009
    Posts:
    20
    NVM.
     
    Last edited: Jun 27, 2013
  26. Lars-Kristian

    Lars-Kristian

    Joined:
    Jun 26, 2013
    Posts:
    64
    Hi, I am using the social network plugin to upload an image to facebook.

    My problem is that sometime it works but not all the time.

    Here is the code I am using:


    FacebookAndroid.init();
    FacebookAndroid.loginWithPublishPermissions(new string[] {"publish_actions"} );
    Facebook.instance.postImage( img.EncodeToPNG(), message, completionHandler );
    FacebookAndroid.logout();



    Is this the proper way to execute this code or do I have to do it in another way?
     
  27. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @lats, I would be surprised if that ever worked at all. You can't just call everything in a row like that. Logging in takes time and you need to wait for the process to complete (the sessionOpenedEvent will fire) before posting on the users behalf.
     
  28. Lars-Kristian

    Lars-Kristian

    Joined:
    Jun 26, 2013
    Posts:
    64
    Is this better?

    Code (csharp):
    1. void FacebookCode()
    2. {
    3.         FacebookManager.sessionOpenedEvent += PostImage;       
    4.         FacebookAndroid.init();
    5.         FacebookAndroid.loginWithPublishPermissions(new string[] {"publish_actions"} );
    6. }
    7.    
    8. void PostImage()
    9. {
    10.         Facebook.instance.postImage( img.EncodeToPNG(), message, completionHandler );
    11.         FacebookAndroid.logout();
    12. }
    If not, can you give me an example of how you would do it?
    I am having a hard time with this.
     
  29. Abza1989

    Abza1989

    Joined:
    Jul 17, 2012
    Posts:
    47
    Hi Prime,

    I was just testing my games Facebook posting and my game crashes when i try to log in. below is the log.

    I/Prime31 (17010): session state: CREATED
    I/Prime31 (17010): launching proxy Activity to intercept SSO login

    And then my app crashes.

    Thanks in Advance.
     
  30. Abza1989

    Abza1989

    Joined:
    Jul 17, 2012
    Posts:
    47
    Hi Prime,

    I was just testing my games Facebook posting and my game crashes when i try to log in. below is the log.

    I/Prime31 (17010): session state: CREATED
    I/Prime31 (17010): launching proxy Activity to intercept SSO login

    And then my app crashes.

    Thanks in Advance.
     
  31. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @abza, how about including a backtrace so that we can see where the crash is actually occurring...
     
  32. NaxiaLascif

    NaxiaLascif

    Joined:
    Jun 10, 2013
    Posts:
    18
    @prime31

    Like @poolts, I am seeing this exact same error in our game, so it has to be a common issue. We haven't repro'd it in-house, but getting the reports just like poolts.
     
  33. sonofbryce

    sonofbryce

    Joined:
    May 19, 2009
    Posts:
    111
    @prime31, I've recently implemented SocialNetworking for Android to use Facebook login features. It appears to work fine on my test tablet, a Samsung Galaxy Tab.

    My problem is that my friend tested on his Samsung Nexus and this dialog pops up when you try to login.

    $tcp_fb_login_samsung_nexus.png

    And when you select either option, nothing appears to happen. I haven't been able to debug on his phone so I'm sure what errors might be popping up.

    This is what I'm calling to start the login:

    Code (csharp):
    1.  
    2.     var permissions = new string[] { "email" };
    3.     FacebookAndroid.loginWithReadPermissions( permissions );
    4.  
    Since I'm figuring certain phones or versions of Android have this screen, is there supposed to be an event I'm waiting for, for the result of this screen? My friend said that games like Candy Crush just displayed the usual Facebook screen immediately when trying to connect. But he found another game that showed this screen, and when he selected OK it then displayed the usual Facebook login screen.

    Thanks for any help with this! ;)
     
  34. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @sonofbryce, that is the normal Facebook login screen for any device with native Facebook integration. Assuming that you properly setup your Facebook app on their website all the normal events will fire.
     
  35. Anonymous3

    Anonymous3

    Joined:
    Jun 5, 2013
    Posts:
    7
    Hi Prime, I was testing chart boost android plugin. I was able to see the interstitial add for some time in the morning. Later, when i run the same code i get the following error ( while caching the interstitial add )

    " 07-08 18:24:21.699: E/Chartboost(9473): Exception on http request: www.chartboost.com "

    Any help please
     
  36. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @anonymous, assuming you have internet access you need to contact Chartboost to find out what the issue is on their servers.
     
  37. sonofbryce

    sonofbryce

    Joined:
    May 19, 2009
    Posts:
    111
  38. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Hi,

    I'm having a little problem with the ShowAlert which is not firing. Here is the code i use:

    This is the code i use to fire the buttons.
    Code (csharp):
    1.  
    2. EtceteraAndroid.showAlert(popupHeader, popupText, "Ja", "Nee");
    3.  
    And the EtceteraAndroidEventListener
    Code (csharp):
    1.  
    2.  
    3. using UnityEngine;
    4. using System;
    5. using System.Collections;
    6. using System.Collections.Generic;
    7.  
    8.  
    9. public class EtceteraAndroidEventListener : MonoBehaviour
    10. {
    11. #if UNITY_ANDROID
    12.     void OnEnable()
    13.     {
    14.         // Listen to all events for illustration purposes
    15.         EtceteraAndroidManager.alertButtonClickedEvent += alertButtonClickedEvent;
    16.     }
    17.  
    18.  
    19.     void OnDisable()
    20.     {
    21.         // Remove all event handlers
    22.         EtceteraAndroidManager.alertButtonClickedEvent -= alertButtonClickedEvent;
    23.     }
    24.  
    25.     void alertButtonClickedEvent(string positiveButton)
    26.     {
    27.         if(positiveButton == "Ja")
    28.         {
    29.             Application.OpenURL("market://details?id=nl.synappz.fysio");
    30.         }
    31.            
    32.     }
    33.  
    34. #endif
    35. }
    36.  
    Am i missing something here?

    Edit:
    Fixed it, i forgot to set the Popupheader string guess android doesn't like empty strings...
     
    Last edited: Jul 11, 2013
  39. skyassasin22

    skyassasin22

    Joined:
    Mar 6, 2013
    Posts:
    1
    Hello, we are planning to buy Google Cloud Messaging Plugin from your site, I wonder if you still support Urban Airship for Android push notification. The documentation does not have info for this.
     
  40. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @sky, Urban Airship is not supported by the plugin.
     
  41. Breakmachine

    Breakmachine

    Joined:
    Sep 19, 2009
    Posts:
    39
    Could you please explain "The values sent are multiplied by the screens dpi on the native side."? Are you talking about Density-independent pixel (dp)? Works fine on a Samsung Galaxy Nexus with ~320 dpi / 2 dp but when using my Samsung Galaxy S which has ~240 dpi it seems to expect a dp of 1 and not 1.5.
     
  42. mcdon00

    mcdon00

    Joined:
    Apr 29, 2013
    Posts:
    2
  43. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    In the Social Networking plugin, when you get an 'object' back from a graph request callback, what is in it? This used to be Hashtables, but as of the last update I installed that's no longer the case, which has broken a bunch of my code.

    Some docs on this would be great, or if they're already around then making them easier to find would be neat.

    Also, having the API change and break my code less often (preferably never) would be neat.
     
  44. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @angry, unfortunately the public API has to change on occasion. We announced the move to generics one year ago which should be ample time to mentally prepare for the change. Perusing either the API docs or just opening the file and reading the comment above the method would lead you to this:

    Code (csharp):
    1. // Sends off a graph request. The completion handler will return a Dictionary>string,object< or List>object< if successful depending on the path called.
    2. // See Facebook's documentation for the returned data and parameters
    3. public void graphRequest( string path, Action<string, object> completionHandler )
    If you want to future proof your code it is a standard best practice to use the lowest class or interface in the object hierchy. In the case IList and IDictionary.
     
  45. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Sure, but in each case what is "object"? Which of those should we expect as the top level object for different type of requests? I probably could write a nice piece of generic code which handles all possible combinations and just pulls out the data I need (it'd be lovely if such a piece of code were included!) but that seems overkill when for my given game there are actually only two requests I need to handle.

    I have further feedback, but I think it's more appropriate for a PM, so I'll send one of those.
     
  46. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @angry, you have to check Facebooks docs to see what it returns. They either return a Dictionary or a List based on the API endpoint. There are only two possibilities and you really can't use a generic bit of code since every endpoint returns totally different data.
     
  47. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Correct me if I'm wrong, but doesn't Facebook return chunks of JSON (or similar) data which you're then mapping into those data structures? I've only looked at their built-in query tool, so I could be wrong, but if it is the case then are you able to provide functionality to print out the different types used to represent the returned data collection? Or does that already exist and I simply haven't found it?

    There may be a better way to do this, but what I ended up doing last night was unwrapping it like an onion - printing the type of object given at one level, writing the next layer of code to read it, and in that layer writing code to print the types contained at that level, redeploying each time since that can't be done in the Editor (again, at least as far as I know). I know that others have used the same approach in the past, as well.
     
  48. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @angry, Facebook will return either a JSON object which amps to a Dictionrary or a JSON array which maps to a List. The Utils.logObject method as seen in the demo scene is useful for dumping the structure to a log.
     
  49. Breakmachine

    Breakmachine

    Joined:
    Sep 19, 2009
    Posts:
    39
    Why am I not getting any response here?

    Could you please explain "The values sent are multiplied by the screens dpi on the native side."? Are you talking about Density-independent pixel (dp)? Works fine on a Samsung Galaxy Nexus with ~320 dpi / 2 dp but when using my Samsung Galaxy S which has ~240 dpi it seems to expect a dp of 1 and not 1.5.
     
  50. lpetre

    lpetre

    Joined:
    Mar 16, 2012
    Posts:
    1
    @prime31

    I'm having trouble with EtceteraAndroid.showWebView("file:///android_asset/terms.html");
    Code (csharp):
    1.  
    2. E/AndroidRuntime(12040): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=file:///android_asset/terms.html }
    3.  
    And then my app crashes.

    On another device, which has the Adobe's PDF reader installed, that will popup and then error that "The document path is not valid.".
    Code (csharp):
    1.  
    2. I/ActivityManager(  445): START u0 {act=android.intent.action.VIEW dat=file:///android_asset/terms.html cmp=com.adobe.reader/.AdobeReader} from pid 32440
    3.  
    This is my code:

    Code (csharp):
    1.     string url = System.IO.Path.Combine(Application.streamingAssetsPath, "terms.html");
    2.     if (Application.platform == RuntimePlatform.Android)
    3.         url = "file:///android_asset/terms.html";
    4.  
    5.     OpenWebView(url);
    6.  
    Code (csharp):
    1.  
    2.     public static void OpenWebView(string url)
    3.     {
    4. #if UNITY_IPHONE
    5.         if( Application.platform == RuntimePlatform.IPhonePlayer )
    6.         {
    7.             EtceteraBinding.showWebPage(url, true);
    8.         }
    9.         else
    10.  
    11. #elif UNITY_ANDROID
    12.         if( Application.platform != RuntimePlatform.Android )
    13.         {
    14.             EtceteraAndroid.showWebView(url);
    15.         }
    16.         else
    17. #endif
    18.         {
    19.             Application.OpenURL(url);
    20.         }
    21.     }
    22.  
    The file is definitely where I think it should be:
    Code (csharp):
    1. $ unzip -l ~/Downloads/DollFactoryTest-Release-1.07.74.apk
    2. ...
    3.     25363  07-23-13 14:12   assets/terms.html
    4. ...
    Any thoughts?

    Thanks