Search Unity

Android Native PlayMaker Actions

Discussion in 'Assets and Asset Store' started by stanislav-osipov, May 17, 2014.

  1. John_1379

    John_1379

    Joined:
    Jan 28, 2015
    Posts:
    15
    What is MNP?
     
  2. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Just when app opens, dupolicated call will be ignored.

    yep.

    Well actully here is IOS Native guide. The logic is very similar to the Android Native, please have a look and let me know if you will have other quiastions:
    https://unionassets.com/iosnative/ios-native-inapp-purchasing-with-playmaker-28


    Thx a lot I will test and fix this.
     
  3. Xomanowar

    Xomanowar

    Joined:
    Apr 2, 2014
    Posts:
    40
    Hello Lacost ... So I bought your plugin, and I'm using it with playmaker to connect on GooglePlay ( Android Native ) , but I've been having some problems ..

    These actions seems not working properly :

    AN_Connect
    AN_Disconnect

    I had success to get the information of the product ( InApp ) .. but any of the actions worked, one of them closes the app ( AN_Consume)
     
  4. John_1379

    John_1379

    Joined:
    Jan 28, 2015
    Posts:
    15
    Hi Stan,

    Thank you very much for the info (very useful) but I still find the 3 playmaker actions (AN_RetriveInventory, AN_ISProductPurchased, AN_RetriveProductInfo) unclear to use for new users (such as myself).

    Questions:

    - How do you set up AN_RetriveInventory? Do you need to save data (Product + Purchases) into FSM strings? Do you leave blank (0)?

    - What does the AN_RetriveInventory result data look like anyway? Purchases is a number? Product is the SKU name? What do you we expect as a result? Are both elements (Purchases & Product) linked to each other and if yes, are they linked by array number - example: "Purchases" FSM string array index 1 data = "Product" FSM string array index 1 data?

    - Do you need to activate AN_RetriveInventory before AN_RetriveProductInfo and/or AN_ISProductPurchased? Or can they work without AN_RetriveInventory as independent actions?

    Many thanks in advance for your great support.
     
  5. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Can you please send you implementation to the stans.assets@gmail.com, so our team will able to have a look and find out what the problem is. Thanks.


    Well this is my bad. I guess creating totorial similart to IOS Native in-apps with Playmaker tutorial will be the best solution here. I will do this to the end of this week, adn will post updated to this thread ASAP!
     
  6. gozdagb

    gozdagb

    Joined:
    Feb 23, 2014
    Posts:
    71
    Hi, i didn't buy yet this addon, but i seriously thinking of buying.
    I am an Playmaker programer and i want to ask, how to save the game for android in playmaker, or how simple is that?
    Its only for saving game in cloud or also in mobile?
     
    Last edited: Feb 4, 2015
  7. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Sorry do you mean how to implement android save games API with the Android Native and playmaker?
     
  8. gozdagb

    gozdagb

    Joined:
    Feb 23, 2014
    Posts:
    71
    Yes i mean that.
     
  9. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    I gues I do not have such actions currently, But I will add it in the new version if Android Native (6.1)
    Cheers!
     
  10. gozdagb

    gozdagb

    Joined:
    Feb 23, 2014
    Posts:
    71
    So i will wait:]
    Thanks.
     
  11. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
  12. gozdagb

    gozdagb

    Joined:
    Feb 23, 2014
    Posts:
    71
    That's AWESOME! I am sure that i will buy this asset, for this moment will wait for little progres in my game.
    Thank you wery much.
    Cheers!
     
  13. John_1379

    John_1379

    Joined:
    Jan 28, 2015
    Posts:
    15
    AMAZING Support. Many thanks for the android In-App Purchasing playmaker tutorial.
     
  14. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Glad you liked it.
    Cheers!
     
  15. Xomanowar

    Xomanowar

    Joined:
    Apr 2, 2014
    Posts:
    40
    Will we have some unityADS actions on the package?

    And in which sequence do I need to use the facebook actions? In my project these actions aren't working.
     
  16. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    There is google ad action in the package.

    Please describe what avtion are you using and what are you trying to achieve.
    Cheers!
     
  17. srenshaw

    srenshaw

    Joined:
    Feb 12, 2014
    Posts:
    14
    Hi, I posted this query back in October and you said it would be added in a later version but I haven't noticed it yet. I'd like to get the current global highscore from the leaderboard and assign it to a variable so that I can display it in the game (using Playmaker). Has this already been implemented and I missed it?

    Thanks.
     
  18. Xomanowar

    Xomanowar

    Joined:
    Apr 2, 2014
    Posts:
    40

    For example, which action initiate FB Api?

    I found: AN_FB_Check_Connection, AN_FB_Log_in

    But any of these actions seems be able to initiate FB service.
     
  19. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hello, sure. Here is full actions list for the Android Native Package:
    https://unionassets.com/android-native-plugin/actions-list-98

    and a bit more articles:
    https://unionassets.com/android-native-plugin/manual#playmaker-an


    AN_FB_Log_in - will start login sequence. If it's not working it may be connected with your app settings, please send me the device log, if you have issue with this action.

    AN_FB_Check_Connection - will simply check if user logged to the facebook.
     
  20. Xomanowar

    Xomanowar

    Joined:
    Apr 2, 2014
    Posts:
    40
    Some actions I think would be nice to have.

    Facebook Init
    Facebook Player data (Image, name, icon etc..)
    Facebook Friendlist
    Facebook Invite Friend
    Facebook Like

    Google Play Player info (Image, name)
    Google Play FriendList.
    Google Plus button +1
     
    Last edited: Feb 17, 2015
  21. srenshaw

    srenshaw

    Joined:
    Feb 12, 2014
    Posts:
    14
    So after using 'AN_Play Service Connect', do I use 'AN_Get Score' to retrieve the current top score from the leaderboard? (I think there may be a spelling mistake in the Playmaker script - ActionLeaderboardsLoeaded)

    It's a real life-saver having Playmaker actions for Android Native, but is there a document anywhere that explains what each of the Playmaker actions is for? For example, I'm not sure what the difference is between 'AN_ShowLeaderboards' and 'AN_ShowLeaderboardUI'.
     
  22. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    yep, after connection is successful.

    Thanks for the report I will do additional documentation.
    AN_ShowLeaderboards - will show leaderboards UI
    N_ShowLeaderboardUI - will show leaderboard UI for spesific leaderboard.


    request accepted.
     
  23. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Agreed I like to see Friendlist, Invite Friend, remove friend, etc.. Friend Player data , name icon, etc. Those are my main three I would love to see as well.
     
  24. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    The only thing I am not sure yet, is how to provide friends array to playmaker users.. I would love to hear your opinion guys.
    Cheers!
     
  25. srenshaw

    srenshaw

    Joined:
    Feb 12, 2014
    Posts:
    14
    I'm still having problems displaying the current leaderboard highscore with Playmaker. I'm using 'AN_Get Score' with the following parameters:

    Time span = ALL_TIME
    Collection = GLOBAL

    It seems to be collecting the leaderboard high score for the current player, rather than the top score on the global leaderboard. There also seems to be a bit of a delay as it often shows the current player's previous high score.

    Thanks.
     
  26. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Well, yes this is what this action suppose to do. it should show current player beset score depending of Time span and Collection.
     
  27. djoshi

    djoshi

    Joined:
    Mar 28, 2014
    Posts:
    182
    Hi Stan, Will you please add Playmaker actions for Real time multiplayer & Turnbased multiplater..
     
  28. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    It can be tricky to manage the multiplayer with the Playmaker actions but I will see what I can do.
    Cheers!
     
  29. Darkuser

    Darkuser

    Joined:
    Jul 30, 2013
    Posts:
    1
    Hi
    How do I get the players information in order to use the Set Ad Targeting action?

    Also, how do I use Load and Show Leaderboard, use the variables, set its size, font, position? Is a script creating the gui element for this? Is there an easy way to change this script so I can get the Leaderboard as public variables so I can put it in a gui element I create myself?

    I'm not sure if you already know, but Playmaker can get and set public variables in scripts in the scene, allowing for us to use and customize the variables as needed on our end.
     
  30. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Well this is up to you. The google API does not provide information about the player, only the player name. If you have another sources how to get it, you can set it to the Ad Targeting action

    Not sure what you mean, since Show Leaderboard action will show default google UI. All you need is to set leaderboard id.

    Cheers!
     
  31. Phuzz

    Phuzz

    Joined:
    Mar 31, 2014
    Posts:
    48
    Sorry I did not notice that there was a Playmaker Forum for android native, I posted my question on the main forum, anyways here is it:

    Im having problems with the GetScore action . I tried it after connection successful it returns a "0", when i try it after "LoadLeaderboards" success event it returns "-1", maybe im missing something?

    Native Plugin 6.2
    Unity 5.0.1

    Thank you
     
  32. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
  33. Paul33993

    Paul33993

    Joined:
    Jan 4, 2015
    Posts:
    27


    Hello,

    I've finished my first game and in the process of trying to add the final elements. I've struggled to understand this package before, so I figured I'd just create a simple test project in Unity (called StansAndroidPluginTesting) and mess around in there before importing into my actual game.

    I'm just clueless about where the Playmaker actions/folders are. I've imported the entire 6.3.1 file in from the Unity Asset Store. I could care less about stuff like the Facebook files, but because I was having zero success, I redeleted multiple times and imported everything from 6.3.1.

    I couldn't find Playmaker actions in unity, so I started going through documentation. Then googling. Am I completely looking in the wrong place? That's the folder you're referring to, correct? Because I don't have a zipped Playmaker folder there.
     
  34. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hello, yes my bad I just noticed that I've accidentally remanded it, so AndroidNativeActions is the folder you looking for.
    Let me know if you need any other help.

    Cheers!
     
  35. Paul33993

    Paul33993

    Joined:
    Jan 4, 2015
    Posts:
    27
    Thanks for clearing that up.

    Used this as an excuse to take a two day break. I've been going 7 days a week on my project and I needed to step away anyways.
     
  36. Paul33993

    Paul33993

    Joined:
    Jan 4, 2015
    Posts:
    27
    I'm going to post this here because it seems like some general info that would be useful for future noobs to see (I think).

    How exactly do you guys handle Sign-in/Auto Sign-in with users who have no connection to wifi/data? Just don't care? Because here's the problem as I see it:

    1.) When using the "Play Service Connect" action, this action "signs you into" Google Play services whether you have a internet connection or not. Which causes issues when you check leaderboard/achievements/submit a successful achievement. Because you get error messages from not having an active connection.

    2.) Unfortunately, when this happens, there's no way to sign out of Google Play services. The "Play Service Disconnect" action does not actually log you out of Google Play. Not truly.

    This action disconnects a user if they successfully signed in with an internet connection to Google Play, but if you "signed in" while there was no internet connection, this action won't sign you out. You're stuck. If you click Leaderboards or Achievements, Google Play will still pop up and give you "no connection" overlays. So you're not truly signing out.

    I have provisions to deal with a user not being signed in (and them clicking these buttons), but it's pretty much over ruled by Google Play still bringing up this overlay (that I don't want in this circumstance).

    3.) Weirdly enough, the "Test Connection" does properly detect whether you actually have an active connection to Google Play or not. If I turn wifi/data off and rig up a button that tests the connection, it'll properly report it's not connected to Google Play. But if I Sign in through "Play Service Connect" action with no internet service, it just counts any contact as a success and creates real issues if the device doesn't have an active internet connection.

    4.) All of this could be avoided if I could test if the user had an active internet connection first. If that was false, I could just abort any auto-login attempt or manual Sign in attempt under these circumstances. But there doesn't seem to be any standard Playmaker action to check this (or maybe there are valid reasons Unity doesn't want you doing this to a user).

    Am I just running into bugs on this? How do you guys handle this all? Thanks.

    EDIT: Also, what exactly is the "Clear Default Acc" supposed to do?

    I'm trying to get everything working for the initial log-in (so it auto-logins and remembers the setting if declined.). I created a new google account just so I could have a fresh account to log into, and it mostly worked, but it wasn't triggering the buttons the way it should have (My "Sign In/Sign Out" states.)

    I'd like to keep signing into Google Play (for the first time) so I can figure out exactly what the glitches are, but once you hit accept, you're obviously never prompted again.

    I thought maybe this Clear Account action would do this, so I wired a dummy button into my scene. It's actually logging me into my account when I press this button (which triggers the Clear Default Acc). It's definitely not clearing any info.

    There's only a single action assigned to this button too. The "Clear Default Acc". If I'm logged out and I start pressing this button a couple times, low and behold I get the "Welcome banner" welcoming me back.
     
    Last edited: May 13, 2015
  37. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Hello,
    The situation with Google Play Connection is following. When player launches the game application and trying connect to Google Play Service at the very first time, internet connection is needed for successful connection. Otherwise, CANCELED connection result will be returned.
    After first successful connection (when internet connection available) to GooglePlay player data will be cached locally.
    So, next connection to Google Play will be completed successfully (in case you didn't call disconnect from Google Play Service manually) even with NO internet connection.
    It's a policy of Google and AndroidNative plugin support it.

    Important: When you are logged into Google Play Service in offline mode, you will not be able to get access to leaderboards, achievements or submit score. Internet connection is strictly needed for this actions.

    As in previous question - the player can connect to Google Play Service with no internet connection if he already made a very first connection successfully. As a result, the player can launch native Leaderboards/Achievements activities, but necessary data will not be loaded because of no internet connection. That's why you get 'No Internet Connection' popup when press on any available leaderboard.

    AndroidNative plugin following Google Play Service policies. So, check results while no internet connection available it's your responsibility as a developer.
    If internet connection available and you are signed into Google Play Service - your actions will be finished successfully.
    In case of NO internet connection - corresponding result with description will be returned.

    If you want not only disconnect from play service, bit also clear user default account for your game (it means user will be prompted to choose his default account for your game again, when you will try to connect).

    Just for reminder - you can find great AndroidNative Google Play Services use cases here.

    If you have any additional questions according to Google Play Services with AndroidNative plugin - feel free to ask any info.
     
  38. Paul33993

    Paul33993

    Joined:
    Jan 4, 2015
    Posts:
    27
    So if a person auto-logins in without a connection, there's no way to clear the cache or anything to allow a Sign out button to truly exit out?

    I ask for this specific reason: Every time achievement data is sent (in this half state), Google will struggle to figure out what's happening, a a little box will pop up on the screen for a second or two.

    Obviously this means if an incremental achievement is sent during the course of gameplay, the game action will be interrupted by this failed action.

    I guess you could just store these events to a variable and update incremental achievements at the end of a round/game instead. This way any failed phone ins would be during downtime in gameplay.

    But that's kind of what I wanted to absolutely verify. That there's no way to force a true logout if you've logged in without a connection. Other than logging out of your account and restarting the game (without an auto-login now triggering).

    Look, I get that some of these things are extreme circumstances not likely to be encountered. I just like to test and have working solutions available for all situations.

    I'm also putting it in this thread because I feel a lot of times everyone has a lot of the same questions, and everyone has to test on their own to discover the limits (if there's not a central answer discussing it). That's why I'm just putting it in this thread (in the event anyone else ever has the same issues. It'll mean one less e-mail for you).



    This is the one thing I haven't found alternative workarounds to.

    Are you saying "Clear Default Acc" is supposed to bring up the Google Play Account request screen? Like when you log into Play for the first time in a game? Cause that's what I was hoping it did.

    If a login to my game, press my test button (triggering the "Clear Default Acc"), and exit out. I still automatically sign in like normal the next time I start up.

    So you're saying, if functioning properly, this SHOULD request my Google Play account info upon Sign in?
     
  39. Paul33993

    Paul33993

    Joined:
    Jan 4, 2015
    Posts:
    27
    Just one more thing. I've taken out auto-Login for 1st time players. I don't enable auto-login unless they've logged in (and haven't manually logged back out). This way I know their true intention. HOWEVER, for a FIRST time login, when they have to manually choose their account and click accept, I'm not getting the Success branch on "Play Service Connect". FYI: "Play Service Connect" is executed in the "Tapped" state.

    The player will successfully login, but my actions in the "Success" state are not executed. Which means two things:

    1.) When that player successfully logs in for the first time, my "Google Plus Sign In" button isn't disabled. Nor is my "Google Plus Sign Out" button now active. So even though the player is signed in, the Sign in button is still active.

    2.) The PlayerPref key isn't written. So the next time they load the game, they will not auto-login.

    From that point forward, anytime a player hits the "Google Plus Sign in" button, the login prefs will be written and the "Sign Out" button will show.

    I don't think my signedIn bool is being written that initial Log In time either. Because I have redundancies built in that would correct inmproper Google Plus Sign in/Sign out buttons.

    I think this was part of the reason I disabled auto-login for initial players to begin with. Because I wasn't able to trust what their real intention was when they signed in for that very first time.

    Any idea on why the "Success Events" don't get executed for the initial Google Play sign up (even when successful).




     
  40. ermak86

    ermak86

    Joined:
    Jan 30, 2014
    Posts:
    14
    Hello,
    OK we have "Google Mobile Ad" actions, this is great! But I have 1 question.

    How I can know when user is clicked at "Ad banner"? And can I make for example - if user click on banner, 10 gold in-game currency will be added to game profile?
     
  41. Paul33993

    Paul33993

    Joined:
    Jan 4, 2015
    Posts:
    27
    Read the ToS that google publishes for admob. If you do that, and they find out, they permanently ban your account. Google does not allow that at all.
     
  42. Paul33993

    Paul33993

    Joined:
    Jan 4, 2015
    Posts:
    27
    The devs are probably looking at some of these posts and wondering WTF I'm going on about and thinking I'm completely incompetent. But I will tell you this: Google Play just kind of flat out sucks. No only do gamers hate it (if you read all the nasty reviews it gets in the Play Store), but it's kind of garbage from this end too. I'm not talking about your Plugin, Stan. That's terrific. And I appreciate it a ton! Thanks!

    Here's the distilled version: Almost always (and maybe ALWAYS), a first ever login would always trigger the "Connect to Play" action to return a "False Event" action.

    And without internet service, the "Connect to Play" would often trigger a "Success Event" that plays absolute havoc with Sign in/Out button states with auto-login triggering.

    So I rigged up a bunch of colored tiles that were running in loops to track certain things. I was bound and determined to scientifically show what's broken and in what state. Fact of the matter is, it's completely random. Google just must be providing some unreliable data. Because sometimes, under these identical circumstances, "Connect to Play" does trigger the proper success/failure events.

    Long story short, I find it completely unreliable to trust it. So I've basically moved most of my "Success" actions into the "Failure" branch too. That may sound like a dumb solution, but it solves 99 percent of the problems. And in that very rare instance where the "Sign Out" button appears when they're not actually signed in, they can just tap it again to get the "Sign In" button to appear. This freaky occurrence will never happen the first time a user logs in. So it's not going to be the first impression they get.

    So, yeah. That's the end of that. All I can say is trust the users intent and base actions off that. It's more reliable.
     
  43. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    As I mentioned earlier, Android Native plugin support Google Play Service implementation guidelines.
    That's not good idea to request player login every time he launch your game application.

    You prompt the player to select Google account for login with first game launch.
    In case of successful login and internet connection availability all following game sessions should be logged-in automatically (even in offline mode).

    You can clear default account every time player close your application. BUT that not the best approach.

    When there is no internet connection, you will get an error while sending achievements data or submitting player score.
    But you get this error in the right place. Cache such events (achievements/player score submitting etc.) is your responsibility as a developer.

    Anyway you can check internet connection availability and disable all logic with data submission for offline mode.
    You can find information according to available APIs in Unity documentation here.

    According to this case you can contact Stan's Assets Support Team directly via e-mail - stans.assets@gmail.com.
    You will get support according your case as soon as possible. I think it will be best decision in your situation.
    Keep in touch and feel free to ask any info.

    Best regards
     
  44. AspartameArt

    AspartameArt

    Joined:
    Jan 28, 2013
    Posts:
    4
    Hello,
    Use google play service with playmaker? This is a wonderful asset!! I really love it!.
    I'd like to know just one more thing to buy this great asset. is there playmaker action for Saving game data to the Google Cloud in this asset? I've seen some one in this forum asked for it, but I couldn't find the update list for the actions.

    So plz let me know about this. I'd so happy if there are the actions! : )

    Thank you.
     
  45. 4arrancho

    4arrancho

    Joined:
    Aug 25, 2013
    Posts:
    3
    Hi

    I'm also interested to know more about save/load features using your asset and playmaker

    Can you give more details about it?

    Thanks
     
  46. Infernomaster

    Infernomaster

    Joined:
    Jan 20, 2013
    Posts:
    16
    @AlexRay

    Could you tell me what the exact workflow is to save/Load with google 'Saved Games'. I can't find a way to save my game (make new Snapshot doesn't realy do anything for me), and there seems to be no option in any of the load action to actually load the data (only metadata). A tutorial is not really necessary, but some docs or a tooltip on the action on what tehy actualy do would be very helpfull.

    Regards,
    Tyb
     
    Last edited: Jul 12, 2015
  47. LimboZone

    LimboZone

    Joined:
    Jun 17, 2015
    Posts:
    19
    Couple things guys has anyone noticed

    AN_Play Serviceinit

    missing from new android native



    also can someone please explain a quick guide of how i use the actions also how i get the fb login working with a buton


    thanx
     
    Morgoth666 likes this.
  48. TogoMango

    TogoMango

    Joined:
    Oct 8, 2014
    Posts:
    5
    Hi, Lacost
    i'm using your plug-In very well. by Playmaker.
    I've some question.
    Only facebook intent has problem When i build share action.
    I seted message & texture in share action.but no appear messages when i test to faecbook sharing.

    <set share action>



    <Twitter> work well.


    <Facebook> no message!


    Olny has this kind of problem when i share facebook.
    Do i have to set someting more for facebook sharing?

    thanks for great tool.
    bye
     
  49. Morgoth666

    Morgoth666

    Joined:
    Oct 29, 2014
    Posts:
    3
    Noticed this too.
    Pls give more details about sign in with playmaker and other playmaker tutorials pls?
     
  50. AlexRay

    AlexRay

    Joined:
    Jul 9, 2014
    Posts:
    993
    Hello,

    Yes, sure. Android Native has a set of Playmaker action to work with game saves.
    Full list of Playmaker actions for Game Saves you can find here.

    Cheers!