Search Unity

[Released] Ultimate Mobile Pro

Discussion in 'Assets and Asset Store' started by stanislav-osipov, Oct 19, 2018.

  1. Grumpy-Dot

    Grumpy-Dot

    Joined:
    Feb 29, 2016
    Posts:
    93
    @lacost
    These are my settings:
    Screenshot_5.png
    Even if they are disabled, as you can see, they are still included in the Requirements section.
    When I do a build, in xcode the description values are reseted to the default value: "Please change .... with IOS Native..."
    If I remove them from the Info.plist section in iOS Native, they are included anyway in the build with the same default values.
     
  2. unity_VhYuS2l_CNrLeA

    unity_VhYuS2l_CNrLeA

    Joined:
    Feb 2, 2019
    Posts:
    3
    hello @lacost , may I ask something regarding on sharing function, how can I share what on my screen on that time to social media platform? I try to test using UM_SharingExample but it only sends the red image and some text. Thanks.
     
  3. Grumpy-Dot

    Grumpy-Dot

    Joined:
    Feb 29, 2016
    Posts:
    93
    If you want to share a screen shot, use this code. First Save the texture:
    Code (CSharp):
    1. Texture2D tex = new Texture2D(Screen.width, Screen.height);
    2. tex.ReadPixels(new Rect(0,0,Screen.width,Screen.height),0,0);
    3. tex.Apply();
    Then use the sharing example to share it.
     
    stanislav-osipov likes this.
  4. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Oh yea, I see why this can feel confusing. I think this is a bug actually. Yes having "not used" list keys in your info.plist files will do no harm for your project, but this is still a bug that I just fixed. Unfortunately, I've already submitted an updated version to the AssetStore, so this bug fix will only be available in the next version release.
    But feel free to DM me in case you would like to ger the latest beta.

    Well because that example using red text image as an example of an image sharing.
    Btw there is a utility provided with the plugin that you may use to take the screenshot and share, check an example below:
    Code (CSharp):
    1. using SA.Foundation.Utility;
    2. using SA.CrossPlatform.Social;
    3. ...
    4.  
    5. SA_ScreenUtil.TakeScreenshot(texture =>
    6. {
    7.     var client = UM_SocialService.SharingClient;
    8.     var builder = new UM_ShareDialogBuilder();
    9.     builder.SetText("Hello world!");
    10.     builder.SetUrl("https://stansassets.com/");
    11.     builder.AddImage(texture);
    12.  
    13.     client.SystemSharingDialog(builder, (result) => {
    14.         if(result.IsSucceeded) {
    15.             Debug.Log("Sharing started ");
    16.         } else {
    17.             Debug.Log("Failed to share: " + result.Error.FullMessage);
    18.         }
    19.     });
    20. });
     
    Grumpy-Dot likes this.
  5. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    New version released 2019.19
    • InApp: Automatic Purchase Acknowledge on Android.
    • InApp: Added an ability to access native platform data directly.
    • InApp: AndroidInAppClient will now print an error if duplicated products found in settings.
    • Local Notification badges API.
    • Game Services Android sing in resolve loop fixed.
    ANDROID
    • Vending: Acknowledge Purchase API added
    • Local Notification badges API.
    • Camera API permissions request fixed.
    • Jar resolver UI additional options added.
    • Added Sing in status codes.
    • Google Play Billing Library updated to 2.0.3.
    • Play Services Games updated to 18.0.1.
    IOS
    • iOS 13 push notification token retrieval fixed.
    • UIAlertControllerStyleActionSheet fixed for iPad.
    • Native Dialogs stack implemented.
    • TvOs GameKit view dismisses fixed.
    • Experimental - MacOs GameKit API support.
    • GameKit API performance improvements.
    • App delegate API, XCode compilation issue fixed.
    • CoreLocation XCode compilation bug fixed.
     
    AppBite and Grumpy-Dot like this.
  6. James-Jo

    James-Jo

    Joined:
    Feb 11, 2019
    Posts:
    10
    Hi.

    Google announced this

    Real-time and turn-based multiplayer services are deprecated
    https://developers.google.com/games/services/common/concepts/turnbasedMultiplayer

    The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.
    https://developers.google.com/android/reference/com/google/android/gms/drive/Drive

    I'm using both of the above features.
    Multiplayer, Save Game
    What is the alternative since this is part of the plugin?
     
  7. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hello @James-Jo are you using Android Native or Android Native Pro?
    Because full multiplayer support was only in first Android Native. The pro version only has the multiplayer in the experimental stage because number of users asked for it.

    I will remove GPS multiplayer implementation from the ANP plugin as soon as Google will deprecate it. I don't think there is a native alternative offered, so I would recommend taking a look at Unity multiplayer solution.

    As for the Drive API. Saved Games API would not be affected by this change. They deprecated Drive API direct access point, but the Saved Games implementation can still relay on it internally.
     
  8. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    Hi, after installing the latest admob package (Googlemobile ads v4.0.0), i get these errors on build
     

    Attached Files:

  9. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    I was able to solve this issue by deleting unity ads sdk, i think both assets may be clashing somehow, but everything works fine once unity ads is deleted
     
  10. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hm.. well another option to avoid the banner crash on ad mob SDK is not to use the banner size option.
    Have you tried just rining the jar resolver? Seems like it should be able to resolve the duplicates problem.
     
  11. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    after installing the latest google admob package, i could no longer build my project and was getting the errors in the screenshots i sent, it seemed like there was a clash between google mobile ads package and unity ads package, but once i deleted the unity ads folders everything seemed to work fine including the admob banner ads
     
  12. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    i would like to ask if "UM_TransactionObserverExample" class is suitable for final release, i tried using the main "UM_iTransactionObserver" interface but it seems like it's an abstract class and can't be instantiated.

    also i don't see any examples on consuming products in ultimate mobile
     
  13. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    The `UM_TransactionObserverExample` is just an example of how you can implement own transaction observer. The `UM_iTransactionObserver` is an interface you need to implement.

    There is no consume in did. Instead, you just need to call the FinishTransaction method it will act accordingly based on the platfrom and the product type.

    I am currently working on a big InApps tutorial where I would try to explain all special cases when workin with InApps, stay tuned :)
     
  14. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68

    I would really appreciate this tutorial as this has been the biggest challenge with your plugin even tho its the best plugin on the asset store.

    do you have any estimated date as to when the tutorial will be released? I would like to know so i can delay my app release because i feel like the tutorial would answer all my questions in in app purchases
     
  15. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    I wanted to make a small app for the tutorial. And the biggest value of the tutorial is not just to show how to implement InApps but EXPLAIN all the edge cases your users might have and EXPLAIN how plugin would handle it. and how you can handle it differently if you would want.

    But a few days ago one of the clines who have a pretty big Android game and using an Ultimate Plugin contacted me with about some potential issues, and know I am spinning my around the Google API and how to find a way to handle few edge cases I became aware of.

    So rough estimate would be around a week once I figure out the proper way to handle some edge cases.
     
  16. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    Oh i understand now, hopefully we get short and easy tutorials on simple implementations of in app purchase and testing on device,

    i would like to ask if google static responses work with ultimate mobile, because i use the addpayment function to test out iap but it doesn't respond

    secondly i would also like to ask if i need to test out the iap through alpha releases as my test app connects to iap services successfully, but when i print out the available products infromation nothing pops up
     
    stanislav-osipov likes this.
  17. Grumpy-Dot

    Grumpy-Dot

    Joined:
    Feb 29, 2016
    Posts:
    93
    @lacost Hello, I have a few suggestions for improvement for UM_GoogleBannerAds class - they are not urgent in any way, but it will improve a bit the usability of the class.

    First suggestion would be to check if m_banner is null in the Hide and Destroy methods, sometimes you might want to call them before the banner actually loaded, and it will give you a NullPointerException.

    Second would be to handle the loading and the state of the google banner automatically - this is more complicated.
    If you call Show banner, this will automatically call Load for you, and show it once the loading is done.
    If you call Destroy in the meantime, it should set a flag and not show it after the loading is done.
    Similar if you call Hide during the loading.

    This is not unique to Google Banner, the other types of ads can be improved similarly.
    Again, this is not urgent, if you want I can share the code I've already made for this in private. Cheers!
     
  18. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hey @Grumpy-Dot, all of those are valid points, thank you for sharing, I will add this into task tracker and you can expect to have it int 2019.21 the 2019.20 will be released shortly so I don't think it will it will be available in that version.
     
    Grumpy-Dot likes this.
  19. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    please in your upcoming tutorial, it would be nice to show the difference between editor and device testing, as this piece of code works perfectly in editor but not on my device, this is what my IAP test scrip looks like, just a simple connect to service, implementation of the transaction observer interface and a purchase function, which takes in product ids to pass into um_service.client.addpayment(). my issue is just simple implementations like this not working.

    thanks!
     

    Attached Files:

  20. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Yes, sure I am working on the first part already.
     
  21. Grumpy-Dot

    Grumpy-Dot

    Joined:
    Feb 29, 2016
    Posts:
    93
    @lacost
    Just to let you know, I was having the same the same issue with in-app purchases on Android as reported by @neowedge . The payments get automatically refunded after 1-2 days.
    This is the case even with the latest version of the plugin, 2019.19.
    Unfortunately I do not have any more info on the cause of the issue, I've switched to Unity IAP for now to see if the issue is fixed.
     
  22. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hey, @Grumpy-Dot that should no happen with the latest ultimate mobile (if you still experiencing this issue please send me the device log) this problem has been fixed in a week after the report. The trick is, the product has to be
    Acknowledged, otherwise, it will be refunded automatically during the 48 hours.

    @Carrmichaelll don't really want to keep you waiting. Please send me the log I will take a look and would be able to let you know what is going wrong for you.

    The tutorial will take some time, I have good progress, but I don't have any experience what so ever in making videos or tutorials, so everything is moving slow, and I have to lower my expectations in term of quality :)
     
  23. Grumpy-Dot

    Grumpy-Dot

    Joined:
    Feb 29, 2016
    Posts:
    93
    @lacost I think I've found the issue.
    I'I was getting the error:
    java.lang.NoSuchMethodError: no static method with name='AcknowledgePurchase' signature='(ILjava/lang/String;Lcom.stansassets.core.interfaces.AN_CallbackJsonHandler;)V' in class Lcom.stansassets.billing.AN_BillingClient;

    Most likely I did not do the update correctly. We have switched anyway to Unity IAP, so I can't test again.
     
  24. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Okay, sad to hear you had to switch. Well, it was my fault for releasing the first implementation with the Acknowledge bug.
     
    Grumpy-Dot likes this.
  25. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Hi @lacost ,

    After the latest release I get a weird error every time I open my project, any idea how can I fix this issue:
    -popup:

    1A.jpg
    -error:
    1B.jpg

    Thanks in advance!
     
    Last edited: Oct 31, 2019
  26. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hey, well looks like you just need to do what it says, please switch to Android API 28.
    Google is replacing support.v4 with Android X library. And I can't use support.v4 anymore since it will conflict with every single google product you may have in your project. There is no backward compatibility between those 2 libraries.

    I didn't know about API level min version required, but hey not like we have much of a chose here :) And it looks like it would be an easy fix for you. Let me know if you need any additional assistance. Thanks.
     
    RoyalCoder likes this.
  27. Nemo_omeN

    Nemo_omeN

    Joined:
    Aug 28, 2019
    Posts:
    12
    Hey @lacost it's Your favourite tvOS team checking-in again. :D
    We've stumbled upon 2 more issues regarding Game Center and we hope to get some input from You on those.
    We're using Unity 2018.4.10f1 and Ultimate Mobile v. 2019.19 (with iOS Native v. 2019.18).

    1. The Game Center login window doesn't show up when we try to login for the second time (both iOS and tvOS):
    We first present the user an opportunity to login during boot sequence. If he cancels this login, he can then login again from the options page. The issue is, though, that when we call UM_GameService.SignInClient.SingIn for the second time the Game Center window doesn't show up for the player and the game blocks (waiting for a response from the UM_GameService.SignInClient.SingIn callback). The curious thing is, that if we minimise the app at this point and maximise it again, the Game Center windows show up and we can successfully login.

    Here's the log after the first (cancelled) login attempt:
    upload_2019-11-7_18-41-51.png

    When we try to login the second time the native logs end at those line and our code is left waiting for the UM_GameService.SignInClient.SingIn callback:
    2019-11-06 14:54:47.854646+0000 TTRWT[4886:2929954] IOSNative::Unity->Native method: _ISN_AuthenticateLocalPlayer data:\
    2019-11-06 14:54:47.854681+0000 TTRWT[4886:2929954] native authenticateLocalPlayer called-2--\

    2. The Game Center UI quits after we focus on the 7th leaderboard (tvOS only):
    When we open the Game Center UI (after a successfull login), we can view both leaderboards and achievements on the same screen (as I reminder - on tvOS there are no separate views for achievements and leaderboards, all of those are on the same view). When we move onto the 7th leaderboard, though, the Game Center UI quits with an error (we get the UM_GameService.AchievementsClient.ShowUI callback from the plugin, but we don't get any error from it - as if viewing the UI was successfull). We don't step into or click any other button other than d-pad arrows when in Game Center UI.
    We even tried to switch postions between leaderboard 7th and 8th, but the result was the same - the 7th leaderboard (doesn't matter which it is) always causes the UI to quit. Also, we can view the formentioned leaderboards on iOS and we're not having any issues there.

    Here's a video to better demonstrate what we're experiencing: https://we.tl/t-z7n9joDieY
    Here's the native log when this happens:
    upload_2019-11-7_18-49-57.png

    Many thanks in advance for Your support (as always!) and keep up the good work. ;)
     
  28. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    Hi, here is the device log i get, there seems to be no products in the

    UM_InAppService.Client.Products list on build
    NullReferenceException: Object reference not set to an instance of an object
    SA.CrossPlatform.InApp.UM_AndroidInAppClient.AddPayment (System.String productId) (at <42f61d98636d445786ad8215aad4af80>:0)
    IapTest.PurchaseItem (System.String id) (at <a33dd0c1feef4cbe976b0f573eb51150>:0)
    UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) (at <982c0d77d98749c6bed0ae705dd14f57>:0)
    UnityEngine.Events.CachedInvokableCall`1[T].Invoke (System.Object[] args) (at <982c0d77d98749c6bed0ae705dd14f57>:0)
    UnityEngine.Events.UnityEvent.Invoke () (at <982c0d77d98749c6bed0ae705dd14f57>:0)
    UnityEngine.UI.Button.Press () (at <e9afdb981db1416b936e214db0ef4df0>:0)
    UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at <e9afdb981db1416b936e214db0ef4df0>:0)
    UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at <e9afdb981db1416b936e214db0ef4df0>:0)
    UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <e9afdb981db1416b936e214db0ef4df0>:0)
    UnityEngine.EventSystems.EventSystem:Update()
     
  29. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hey, @Carrmichaelll I finally was able to complete tutorial, please have a look and let me know if you still would have some issues. If you will, let's set up a skype call so I can help you with your problem. Thanks!

    So the first part of the In-Apps tutorial is there! I hope to improve in the future so critics and comments are highly appreciated. Thank you!
    I wanted to keep it short, but it's so much info I have to tell. The first part is around 20min, the next, more platfrom specific parts would be shorter.
    Enjoy :)
     
  30. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hey, @Nemo_omeN thx for the detailed reproduction steps. I will check this case and will send you an updated version.

    For the second case you have mentioned, well, it's a pretty weird one. I don't see any errors in the log, the behavior is the same as if you just trying close the window. Not errors.

    I will try to find info about it but seems more like a problem on the Apple side. Thanks for the report tho I will see if I can do something about it. Thanks!
     
  31. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    The new version released 2019.20
    • InApps: connection to the billing service without the internet will now return an error if no products returned from the android local billing service cache.
    • InApps: fixed processing of the iOS failed transaction during the Purchasing state.
    • InApps: product Type & Image filed values fixed.
    • InApps: transaction time bug fixed for the Android platfrom.
    • InApps: added ability to defined products via C# before connection to the payment service.
    • Game Service: Android game service SingIn the client will now handle missing Google Play app automatically.
    • Google Admob recommended version updated to 4.0.0.
    • Unity 2017 compilation bug fixed.

    ANDROID
    • Vending and Notification services will not throw an error on usage attempts when service is disabled.
    • Vending Licensing UI updated.
    • AndroidX library updated to 1.1.0.
    • BillingClient QueryPurchaseHistoryAsync method added.
    IOS
    • ISN_SKPaymentOriginalTransaction C# 4.0 warning fixed.
    • Date-time picker dark theme support added.
    • UIKit Disabled Plist variables bug fixed.
     
    Grumpy-Dot likes this.
  32. Nemo_omeN

    Nemo_omeN

    Joined:
    Aug 28, 2019
    Posts:
    12
    @lacost
    We got news on the 2nd issue (The Game Center UI quits after we focus on the 7th leaderboard (tvOS only)) it was related to leaderboard data not filled properly on the iTunes Connect site, so no need to investigate it further, thanks and sorry for wasting Your time! :)

    Also, did You manage to reproduce the 1st issue (The Game Center login window doesn't show up when we try to login for the second time (both iOS and tvOS))? This one we couldn't resolve on our end I'm affraid. ;)
     
  33. ShyRec

    ShyRec

    Joined:
    Jun 30, 2013
    Posts:
    18
    @lacost Hi, we are having some problems with native dialogues. I tried both caching builders and creating new instances every time dialogue is shown, but still sometimes dialogue not showing.

    E/Unity ( 1904): AndroidJavaException: android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@302c9a8b is not valid; is your activity running?

    E/Unity ( 1904): android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@302c9a8b is not valid; is your activity running?

    E/Unity ( 1904): at android.view.ViewRootImpl.setView(ViewRootImpl.java:687)

    E/Unity ( 1904): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:288)

    E/Unity ( 1904): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)

    E/Unity ( 1904): at android.app.Dialog.show(Dialog.java:312)

    E/Unity ( 1904): at android.app.AlertDialog$Builder.show(AlertDialog.java:991)

    E/Unity ( 1904): at com.stansassets.android.app.dialogs.AN_AlertDialog.Show(AN_AlertDialog.java:119)

    E/Unity ( 1904): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)

    E/Unity ( 1904): at com.unity3d.player.UnityPlayer.c(Unknown Source)

    E/Unity ( 1904): at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source)

    E/Unity ( 1904): at android.os.Handler.dispatchMessage(Handler.java:98)

    E/Unity ( 1904): at android.os.Looper.loop(Looper.java:145)

    E/Unity ( 1904): at com.unity3d.playe
     
  34. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    I am on it right now, will post an updated here shortly :)


    Hey, Unfortunately, the log you provided does not shave any dialog related messages.
    Let's try to go another route. Can you give me code sample (or even PM me a sample project if possible)

    As far as I understood from your message some time dialog doesn't show up. Am I right?
     
  35. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Ahh, yes I understand why it's confusing. I will update API and example a bit and will make a big post with explanation of how it those cases should be treated according to Apple Design and how you implementation should look like with the plugin.

    Thanks.
     
  36. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    Hi my understanding of um_inap service is a lot clearer now, set an observer, connect to the service and get your purchases underway. however, i'm trying to test my app without having to upload an apk for alpha testing but using ultimate mobile causes a null reference error whenever i call the Addpayment(string product_id) function. but it works perfectly in the editor, by the way i'm using google play's static products like (android.test.purchased). I have a feeling your plugin doesn't check for these ids behind the scenes.

    thanks!
     
  37. Nemo_omeN

    Nemo_omeN

    Joined:
    Aug 28, 2019
    Posts:
    12
    Ok, we're eager to read the explanatory post and implement accordingly. Thanks @lacost! ;)
     
  38. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Can I assume that you watched the video with an explanation?
    I have a feeling that you trying to purchase a product with that Id, but you haven't added it into request products list for Android. Can I have a log, please?

    Thanks!
     
  39. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    wow! thank you so much! that was the problem, i didn't think it was necessary to add the static products into the product list, it works perfectly now, thanks!
     
  40. Grumpy-Dot

    Grumpy-Dot

    Joined:
    Feb 29, 2016
    Posts:
    93
    @lacost Hello, would it be possible to request LoadPlayerCenteredScores for Leaderboards on iOS in the same way as it's implemented for Android? And of course, request it through Ultimate Mobile with a common API?
    If you already plan to implement this, and have an idea for it, please send me the code. Thanks!
     
  41. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    I glad I was able to help. Yea test Android products are acting absolutely the same was as normal products (thx Google, I mean for real) you can just assume those products are always configured for your app.


    I don't actually have an idea yet. BUT I want to implement this feature by the next release (few weeks) so... stay tuned :)
     
  42. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    @Nemo_omeN here it goes :)
    I will also send you an updated version (I had to change a few small but important things).
    For anybody else who experiences the same problem, please feel free to poke me for an early beta version.

    The IOS Nativ Pro plugin ISN_GKLocalPlayer.Authenticate method above is deprecated. Use the setAuthenticateHandler instead.
    Code (CSharp):
    1. ISN_GKLocalPlayer.setAuthenticateHandler(HandlerUserAuthentication);
    2.  
    3. private void HandlerUserAuthentication(SA_Result result) {
    4.     if (result.IsSucceeded) {
    5.         Debug.Log("Authenticate is succeeded!");
    6.     } else {
    7.         Debug.Log("Authenticate is failed! Error with code: " + result.Error.Code + " and description: " + result.Error.Message);
    8.     }
    9. }
    The reason it was changed is the following:
    When people see the Authenticate method name they assume it can be called several times per application session. Wich is wrong.

    Let's talk about a few scenarios that may happen and how your implementation should react to it.

    The implementation first.
    All you need to do is to subscribe to the AuthenticateHandler (see the code snippet above) as soon as possible after your game launches.

    This method call will start auth flow for the user.
    You should never call setAuthenticateHandler again during the application session.

    But user status may change, so expect the callback you set with using setAuthenticateHandler method will be called several times (in case user auth status is changed) and you need to react accordingly (update your UI, set code flags, whatever else you need to update based on the user GC auth state)

    User flows:
    1. Game lunched and setAuthenticateHandler called.
    2. The user auth is succeeded.
    3. All Good

    This is the most common scenario and the most simple one. Let's now talk about a few more complicated items.
    1. Game lunched and setAuthenticateHandler called.
    2. The user auth is failed.
    3. The user plays the game without GC.
    4. User clicks Leaderboards button (any other piece of GC related UI in your game)
    You probably want to restart the auth and give the user an ability to auth in GC without leaving your app.

    Well, you can't do that. You can't control when GC auth dialog appears.

    BUT if a user is failed in the first place, there is only one way how it could happen.

    The GC auth state is configured in the iOS settings application and shared across all the installed apps. So if a user has signed in GC once, your game will no show ANY DIALOG and the user will be signed right away without any additional UI, warnings, permissions requests, etc. The user CAN'T ban ONLY your game from using GC. This is a global system state.

    Now, if you got the failed auth state, here is what happened. The user hasn't configured the GC account on his device. When he launched your game, the GC sing-in dialog appeared, and the user has declined it. And if the user declined in once, Apple won't allow to bother him with the same dialog again during the active app session.

    So what should you do if the user specifically requested some GC related feature using your game UI (at this point you UI should kind of acknowledge that functionality isn't available by its appearance).

    The only thing you can do is to show the dialog with the explanation that the user has to sing in the system GC application. You may also launch a setting app for the user and open it on the GC page (but that's app to you)

    TL; DR;

    User need to leave your application and sing using iOS settings app, or restart your app (fold/unfold would work as well)

    Nex scenario.
    1. Game lunched and setAuthenticateHandler called.
    2. The user auth is failed.
    3. The user plays the game without GC.
    4. User exists your app (without closing)
    5. User opens your app again -> the GC sing in the dialog will be present
    You don't need to do anything in order to implement this case. If the user wasn't singed with GC, every time he will open your application, the GC sing in the dialog will show up. And since you already subscribed to Authg HAndler, you will get an update every time it happens.

    So you only need to be aware that HandlerUserAuthentication (see the snippet above) may be called several times per session and act accordingly.
    1. Game lunched and setAuthenticateHandler called.
    2. The user auth is failed.
    3. The user plays the game without GC.
    4. User exists your app (without closing)
    5. User sings-in into GC using the settings app.
    6. User opens your app -> You are getting auth callback with success state.
    Another one:
    1. Game lunched and setAuthenticateHandler called.
    2. User auth is succeeded.
    3. The user plays the game.
    4. User exists your app (without closing)
    5. The user decided to change the GC account or sing out using the GC settings app.
    6. User opens your app -> You are getting auth callback with new user info or failed auth state.
    That's about it. And there is a small part from the Apple docs that is related to what we are talking about here:
    What does it mean for the Ultime Mobile PRO?
    Pretty much the same:
    • Call the UM_GameService.SignInClient.SingIn only once on the application launch.
    • Subscribe to the UM_GameService.SignInClient.OnPlayerUpdated callback, be prepared to receive that callback at any time and even a few times per session. User auth state or user info may change.
    • Make sure you can update your app UI / state accordingly when the callback is received.
     
  43. Grumpy-Dot

    Grumpy-Dot

    Joined:
    Feb 29, 2016
    Posts:
    93
    Unfortunately I need this feature asap, so I will start with just Android implementation for now. If you manage to find time for iOS and have an idea to implement it for that as well, please send me the code.

    Thanks!
     
    stanislav-osipov likes this.
  44. Webbstre

    Webbstre

    Joined:
    Mar 7, 2015
    Posts:
    41
    Not sure if the Support form went through so I'll ask here as well: I'm on Windows, and am getting this error:
    Unable to parse file Assets/Plugins/StansAssets/NativePlugins/IOSNativePro/XCode/UIKit/ISN_UIDateTime.mm.meta: [did not find expected key] at line 14

    I don't use the iOS features and it didn't give me this error before updating, so I'm not sure what the problem is.
     
  45. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    That's the meta file... so looks like Unity version or something. As the quick fix - just remove the file and Unity will re-create it.
    The only one concern, to make sure you will able to update smoothly, copy old meta-file id, and make sure that new one has the same id.
     
  46. garrido86

    garrido86

    Joined:
    Dec 17, 2013
    Posts:
    233
    Greetings @lacost !
    Thank you for making this great asset, super useful!

    Now I have an usual request, is it possible to just open on Android the Gallery/Photo App but without picking any images? Just opening the photo app and that's it.

    On iOS we solved this easily by just calling "Application.OpenURL("photos-redirect://");" but for Android we have nothing similar. Can you maybe help us out or give a hint?

    Thank you very much!

    //Edit
    Thank you for your email response!
     
    Last edited: Dec 6, 2019
  47. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Sorry, @garrido86 notice your email and post a bit late.
    Just for the sake of forum history, my suggestion was to use the code sample from here:
    Code (CSharp):
    1. Intent intent = new Intent();
    2. intent.setAction(android.content.Intent.ACTION_VIEW);
    3. intent.setType("image/*");
    4. intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    5. startActivity(intent);
    https://stackoverflow.com/questions/16928727/open-gallery-app-from-android-intent/23821227

    And to translate this code using Android Native Pro, so it can be used via C#
    Code (CSharp):
    1. var intent = new AN_Intent();
    2. intent.SetAction(AN_Intent.ACTION_VIEW);
    3. intent.SetType("image/*");
    4. intent.AddFlags(AN_Intent.FLAG_ACTIVITY_NEW_TASK);
    5. AN_MainActivity.Instance.StartActivity(intent);
    But from @garrido86 use experience intent.SetType("image/*"); gives undefined behavior on different devices across vendors. "File not found", "File format not supported" or just a crash.
     
  48. zgredziucha

    zgredziucha

    Joined:
    Dec 17, 2013
    Posts:
    1
    Hi! I think the https://stansassets.com/ is down. I wanted to check out documentation because I consider buying Ultimate Mobile Pro, but no link on the Asset Store page is working :(
     
  49. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    My bad, I am already working on it.
     
  50. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Forgot to make an updated that everything is up and running :)