Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Easy Mobile - Many-in-one package for mobile games

Discussion in 'Assets and Asset Store' started by pt5011, Jan 28, 2017.

  1. 7fan

    7fan

    Joined:
    Mar 7, 2014
    Posts:
    7
    Hi I've been away busy for some projects handling. I will check again, but for the while I did not used it as it was found that it was competing with Unity InApp system.

    Thanks,
    7fan
     
  2. nichekeys

    nichekeys

    Joined:
    Oct 2, 2014
    Posts:
    1
    I have error "googlemobileads.h file not found" when I build in xcode
     
  3. sniffle63

    sniffle63

    Joined:
    Aug 31, 2013
    Posts:
    197
    Hello, i cant get the game center services to log in.

    I tried auto init and not auto init. Iv tried redoing the google services and google play console project twice now.

    The first time it was saying ERROR_NOT_AUTHORIZED. (on that project i was not using google app signing and am 100% sure my sha1 is the same as my keystore i created in unity)

    so i tried making a blank project and using google app sign and that as my auth2.0 sha1, now when i run the game and attempt to initialize and show a leaderboard it displays this (well nothing at all is debugged when i click leaderboard stuff, no pop up or anything, just does nothing) and clicking init just repeats the last line in the console.

    been working at it for 3 days now,So here i am posting here
     

    Attached Files:

    Last edited: Jun 4, 2018
  4. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    54
    Hi,

    I'm planning on using ads and Unity Ads as the network. Is the "Reward" ads configuration for your plugin the one that shows Unity Rewarded VIDEO ads?

    This is the code in your plugin's documentation but it doesn't specify if it is for rewarded video ads:

    // Check if rewarded ad is ready
    bool isReady = Advertising.IsRewardedAdReady();

    // Show it if it's ready
    if (isReady)
    {
    Advertising.ShowRewardedAd();
    }



    Thanks
     
  5. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    54
    Hi, and another question, besides the one from the previous message, is the Resources configuration for notifications only for local notifications? Because the push notifications arrive with the icons from OneSignal.
    I created the "res" folder using the website you provided to create all the icons and folders, imported the folder (successfully), configured the other stuff related with the categories and such, pretty much typed the same that you wrote in the documentation.
    I can send the notifications from the OneSignal dashboard but every message shows the icons from OneSignal, or, how do I need to send those messages? I still don't know how I'm supposed to use the ID's configured for the categories. I need to admit that I haven't tried local notifications because I only need the push ones.

    Thanks.
     
  6. Mr-Oliv

    Mr-Oliv

    Joined:
    Sep 14, 2012
    Posts:
    27
    Hi everyone! In my current project I'm using the Sharing functionality, but it suddenly stopped working. I have a feeling the native plugins are no longer compiling since I've verified the Java call is made in AndroidUtil.cs. I've reimported the plugin... downloaded the resolver... Do I need to do anything else to make this work?
    Thanks!
     
  7. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    54
    Hi again and here I go with a third question. Should I use a different channel for asking all this or is it ok if I SPAM the forum thread?

    Anyway, this question is regarding the recently "hot topic" of privacy. I'm sure you all heard about Facebook and more recently receiving a ton of emails of the new law in Europe (GDPR regulation).
    So, when using Push notifications configured with OneSignal, as soon as the EasyMobile initializes, OneSignal gets the user (phone's information) data to their servers without giving time to "consent" such act as required by that law (and others). So basically by that time you are screwed. Implementing the OneSignal SDK alone gives that flexibility to initialize OneSignal but placing it "on hold" until the user either accepts the Privacy Policy or rejects it, but that kills the purpose of the EasyMobile plugin. If the user accepts it, then send the info to OneSignal. But if the user rejects it, you are allowed to block certain info from being sent to OneSignal but still being able to keep the Push notifications working (or also blocking push notifications altogether).

    So the question is, how can we access those features to have the flexibility to comply with the privacy laws? Or how can we "separate" the initialization from the main EasyMobile plugin? A way to split the push notifications from the local ones would be a first step but also being able to access initialization methods/features from OneSignal would be ideal.

    In case you didn't know, by using OneSignal, you are sending your app's users information to OneSignal and once they get it, they can sell that information to as many third-parties as they want, and that's no good if your users didn't agree to do so.

    Thanks.
     
  8. ibps13

    ibps13

    Joined:
    Oct 6, 2012
    Posts:
    113
    Hi,

    I'v just finishished to add this to my IOS app, I have 3 subscriptions product, I can buy them and on sandbox mod, purshase are confirmed, all works fine.

    But when I try to get receipt like you show me, data are always empty: isSubscribed, isExpired etc...

    I use code that you recommend:

    Code (CSharp):
    1.  Dictionary<string, string> dict = InAppPurchasing.StoreExtensionProvider.GetExtension<IAppleExtensions>().GetIntroductoryPriceDictionary();
    2.         foreach (Product item in InAppPurchasing.StoreController.products.all)

    Full function:

    Code (CSharp):
    1.  
    2. // Check if user have subscription and renew in wp if nescessary
    3.     IEnumerator CheckOwnedProducts()
    4.     {
    5.         yield return new WaitForEndOfFrame();
    6.         if(isInitialized)
    7.         {
    8.             //*****************************************************************
    9.             //
    10.             // GET INFO SUBSCRIPTION MOBILE VIA RECEIPT IF EXIST
    11.             //
    12.             //*****************************************************************
    13.             Dictionary<string, string> dict = InAppPurchasing.StoreExtensionProvider.GetExtension<IAppleExtensions>().GetIntroductoryPriceDictionary();
    14.        
    15.             if(Constants.DEBUG)Debug.Log("dict count = "+dict.Count);
    16.  
    17.             foreach (Product item in InAppPurchasing.StoreController.products.all)
    18.             {
    19.                 if(Constants.DEBUG)Debug.Log("item.receipt = "+item.receipt);
    20.            
    21.                 // this is the usage of SubscriptionManager class
    22.                 if (item.receipt != null)
    23.                 {
    24.                     if(Constants.DEBUG)Debug.Log("ProductType = "+item.definition.type);
    25.                
    26.                     if (item.definition.type == ProductType.Subscription)
    27.                     {
    28.                         string intro_json = (dict == null || !dict.ContainsKey(item.definition.storeSpecificId)) ? null :  dict[item.definition.storeSpecificId];
    29.                    
    30.                         SubscriptionManager p = new SubscriptionManager(item, intro_json);
    31.                         SubscriptionInfo info = p.getSubscriptionInfo();
    32.                    
    33.                         productId = info.getProductId();
    34.                         purchaseDate = info.getPurchaseDate().ToDdMmYySlash().ToString();
    35.                         expireDate = info.getExpireDate().ToDdMmYySlash().ToString();
    36.                         isSubscribed = info.isSubscribed().ToString();
    37.                         isExpired = info.isExpired().ToString();
    38.                         isCancelled = info.isCancelled().ToString();
    39.                         isFreeTrial = info.isFreeTrial().ToString();
    40.                         isAutoRenewing = info.isAutoRenewing().ToString();
    41.                         getRemainingTime = info.getRemainingTime().TotalDays.ToString();
    42.                         isIntroductoryPricePeriod = info.isIntroductoryPricePeriod().ToString();
    43.                         getIntroductoryPrice = info.getIntroductoryPrice();
    44.                         getIntroductoryPricePeriod= info.getIntroductoryPricePeriod().TotalDays.ToString();
    45.                         getIntroductoryPricePeriodCycles = info.getIntroductoryPricePeriodCycles().ToString();
    46.                         getSubscriptionPeriod = info.getSubscriptionPeriod().TotalDays.ToString();
    47.                    
    48.                         if(Constants.DEBUG)Debug.Log("getProductId ="+info.getProductId());
    49.                         if(Constants.DEBUG)Debug.Log("getPurchaseDate ="+info.getPurchaseDate());
    50.                         if(Constants.DEBUG)Debug.Log("getExpireDate ="+info.getExpireDate());
    51.                         if(Constants.DEBUG)Debug.Log("isSubscribed ="+info.isSubscribed());
    52.                         if(Constants.DEBUG)Debug.Log("isExpired ="+info.isExpired());
    53.                         if(Constants.DEBUG)Debug.Log("isCancelled ="+info.isCancelled());
    54.                         if(Constants.DEBUG)Debug.Log("isFreeTrial ="+info.isFreeTrial());
    55.                         if(Constants.DEBUG)Debug.Log("isAutoRenewing ="+info.isAutoRenewing());
    56.                         if(Constants.DEBUG)Debug.Log("getRemainingTime ="+info.getRemainingTime());
    57.                         if(Constants.DEBUG)Debug.Log("isIntroductoryPricePeriod ="+info.isIntroductoryPricePeriod());
    58.                         if(Constants.DEBUG)Debug.Log("getIntroductoryPrice ="+info.getIntroductoryPrice());
    59.                         if(Constants.DEBUG)Debug.Log("getIntroductoryPricePeriod ="+info.getIntroductoryPricePeriod());
    60.                         if(Constants.DEBUG)Debug.Log("getIntroductoryPricePeriodCycles ="+info.getIntroductoryPricePeriodCycles());
    61.                         if(Constants.DEBUG)Debug.Log("getSubscriptionPeriod ="+info.getSubscriptionPeriod());
    62.                    
    63.                         //*****************************************************************
    64.                         //
    65.                         // RENEWAL SUBSCRIPTION TO WP
    66.                         //
    67.                         //*****************************************************************
    68.                         //If user have a valid renewal mobile subscription
    69.                         //and suscription on site expired, renew it
    70.                         if(has_subsciptiondebug == "expired")
    71.                         {
    72.                             if(isSubscribed == "" && isExpired == "")
    73.                             {
    74.                                 if(Constants.DEBUG)Debug.Log("isSubscribed && isExpired values are empty");
    75.                             }
    76.                             else
    77.                             {
    78.                                 if(isSubscribed == "Result.True" && isExpired == "Result.False")
    79.                                 {
    80.                                     RenewalSubscriptionMetaUser( ParseRenewalResponse, ( cmlData result ) => Debug.LogWarning( result.String( "message" )));
    81.                                 }
    82.                             }
    83.                        
    84.                         }
    85.                     }
    86.                     else
    87.                     {
    88.                         if(Constants.DEBUG)Debug.Log("the product is not a subscription product");
    89.                     }
    90.                 }
    91.                 else
    92.                 {
    93.                     if(Constants.DEBUG)Debug.Log("the product should have a valid receipt");
    94.                 }
    95.             }
    96.             //*****************************************************************
    97.             //
    98.             // END
    99.             //
    100.             //*****************************************************************
    101.         }
    102.     }
    103.  
    Any idea why all values are empty ?

    Some log:

    Code (CSharp):
    1.  
    2. [B]dict count = 3[/B]
    3.  
    4. [B]<CheckOwnedProducts>c__Iterator0:MoveNext()[/B]
    5.  
    6. [B]UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)[/B]
    7.  
    8.  
    9.  
    10. [B](Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)[/B]
    11.  
    12.  
    13.  
    14. [B]item.receipt = [/B]
    15.  
    16. [B]<CheckOwnedProducts>c__Iterator0:MoveNext()[/B]
    17.  
    18. [B]UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)[/B]
    19.  
    20.  
    21.  
    22. [B](Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)[/B]
    23.  
    24.  
    25.  
    26. [B]the product should have a valid receipt[/B]
    27.  
    28. [B]<CheckOwnedProducts>c__Iterator0:MoveNext()[/B]
    29.  
    30. [B]UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)[/B]
    31.  
    32.  
    33.  
    34. [B](Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)[/B]
    35.  
    36.  
    37.  
    38. [B]item.receipt = [/B]
    39.  
    40. [B]<CheckOwnedProducts>c__Iterator0:MoveNext()[/B]
    41.  
    42. [B]UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)[/B]
    43.  
    44.  
    45.  
    46. Product_1_mois, achat réussi
    47. EasyMobile.StoreListener:ProcessPurchase(PurchaseEventArgs)
    48. UnityEngine.Purchasing.PurchasingManager:ProcessPurchaseIfNew(Product)
    49. UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
    50. UnityEngine.Purchasing.AppleStoreImpl:OnProductsRetrieved(String)
    51. UnityEngine.Purchasing.Extension.UnityUtil:Update()
    52. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    53.  
    54. 2018-06-08 08:25:13.892885+0200 pronos[1497:1060342] UnityIAP: Transaction 1000000405741094 not pending, nothing to finish here
    55. UnityIAP: Promo interface is available for 2 items
    56. UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
    57. UnityEngine.Purchasing.AppleStoreImpl:OnProductsRetrieved(String)
    58. UnityEngine.Purchasing.Extension.UnityUtil:Update()
    59.  
    Any idea ?

    thanks
     
    Last edited: Jun 8, 2018
  9. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    So you also sent this question to our support email correct? I believe we answered it. Please check.
     
  10. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    Please open the .xcworkspace instead of .xcodeproj.
     
  11. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    EM can show rewarded ads from all supported networks, not just Unity Ads. You can choose the default rewarded ad network for your app in a dropdown list of networks near the bottom of the Advertising module settings.

    The example code is indeed for checking the availability of a rewarded ad and then show it.
     
  12. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    Please follow the instructions here to customize OneSignal icon https://documentation.onesignal.com/docs/customize-notification-icons

    The Resource configuration is intended to be used with local notifications. But in fact, it can be used to add any Android-compatible resources to your app so they can be used in the apk build.
     
  13. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    Probably the required Android native library was somehow missing. Please go to menu Assets > Play Services Resolver > Android Resolver > Force Resolve. After the resolution completes you should find a com.sglib.easymobile.easy-mobile-1.x.x file in the Assets/Plugins/Android folder.
     
  14. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    We're investigating this issue, not just notifications but also ads and other services.

    In the mean time, we propose the following workflow:

    1- Disable Easy Mobile's auto-init for the Notifications module.
    2- Call OneSignal.SetRequiresUserPrivacyConsent(true); to delay the initialization of OneSignal SDK until the user provides consent
    3- Call EasyMobile.Notifications.Init to initialize the module (so local notifications work), OneSignal as mentioned will delay itself
    4- Use OneSignal.PromptForPushNotificationsWithUserResponse(callback) to prompt for user consent using the default system prompt (iOS only) or build your own dialog to collect user consent.
    5- Once the user consent is collected, call OneSignal.UserDidProvideConsent(true); so OneSignal can finish its initialization.

    OneSignal API for Unity reference https://documentation.onesignal.com...--promptforpushnotificationswithuserresponse-
     
  15. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    @ibps13
    Any reason why you're converting all the variables to string? For testing purpose?
    So by "data are always empty" you mean this condition satisfied?

    Code (CSharp):
    1. if(isSubscribed == "" && isExpired == "")
    2.                             {
    3.                                 if(Constants.DEBUG)Debug.Log("isSubscribed && isExpired values are empty");
    4.                             }
    5.                            
    this would be really strange as isSubscribed and isExpired are originally of type UnityEngine.Purchasing.Result enum (can only be 'True', 'False' or 'Unsupported') so they can't really be empty after converted to string.

    How about the result of these calls, can you share the log?
    Code (CSharp):
    1. if(Constants.DEBUG)Debug.Log("getProductId ="+info.getProductId());
    2.                         if(Constants.DEBUG)Debug.Log("getPurchaseDate ="+info.getPurchaseDate());
    3.                         if(Constants.DEBUG)Debug.Log("getExpireDate ="+info.getExpireDate());
    4.                         if(Constants.DEBUG)Debug.Log("isSubscribed ="+info.isSubscribed());
    5.                         if(Constants.DEBUG)Debug.Log("isExpired ="+info.isExpired());
    6.                         if(Constants.DEBUG)Debug.Log("isCancelled ="+info.isCancelled());
    7.                         if(Constants.DEBUG)Debug.Log("isFreeTrial ="+info.isFreeTrial());
    8.                         if(Constants.DEBUG)Debug.Log("isAutoRenewing ="+info.isAutoRenewing());
    9.                         if(Constants.DEBUG)Debug.Log("getRemainingTime ="+info.getRemainingTime());
    10.                         if(Constants.DEBUG)Debug.Log("isIntroductoryPricePeriod ="+info.isIntroductoryPricePeriod());
    11.                         if(Constants.DEBUG)Debug.Log("getIntroductoryPrice ="+info.getIntroductoryPrice());
    12.                         if(Constants.DEBUG)Debug.Log("getIntroductoryPricePeriod ="+info.getIntroductoryPricePeriod());
    13.                         if(Constants.DEBUG)Debug.Log("getIntroductoryPricePeriodCycles ="+info.getIntroductoryPricePeriodCycles());
    14.                         if(Constants.DEBUG)Debug.Log("getSubscriptionPeriod ="+info.getSubscriptionPeriod());
     
  16. Gardenman

    Gardenman

    Joined:
    Aug 28, 2014
    Posts:
    1
    Hey! Is possible to load scores from leaderboard to make it on custom UI?
     
  17. ibps13

    ibps13

    Joined:
    Oct 6, 2012
    Posts:
    113
    @pt5011

    Hi,
    Any reason why you're converting all the variables to string? For testing purpose?

    No, I'v changed that.. :)

    I'v ccreated products on InApp EasyMobile panel settings but apparently I need to create products in Unity InApp panel too, and now I can get all receipt values and works fine.

    I use Unity 2017.4.2f1 InApp 1.19, last EasyMobile version
     
  18. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    @Gardenman Yes we have methods to load scores from leaderboards.
     
  19. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    @ibps13 Glad it works :)

    But by "Unity InApp panel" do you mean the panel at menu Window > Unity IAP > IAP Catalog? That's for codeless IAP and AFAIK the products created there will only be registered if you have at least one UnityIAP button in your scene, or the Automatically initialize UnityPurchasing (recommended) option in that IAP Catalog panel is checked, so that UnityPurchasing initializes itself in runtime (https://docs.unity3d.com/Manual/UnityIAPCodelessIAP.html)

    In our case, EM does the initialization for you and it will programmatically register the products created in EM settings during the process, which is equivalent to creating them in IAP Catalog. So I believe there's no need to create the products twice (in EM settings and then in IAP catalog). You may want to try removing the products in IAP Catalog and perform a quick test to verify that.
     
  20. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    Just submitted updates for EM Pro and Basic :)
    The new updates will include support for Firebase Cloud Messaging and new methods to get and set application badge number on iOS. Hopefully they will be available in a few days!
     
  21. soufiane159753

    soufiane159753

    Joined:
    Jul 28, 2017
    Posts:
    3
    Hi,
    when i import the chartboost plugin and i want to export the apk i got this error
     

    Attached Files:

    • 55.png
      55.png
      File size:
      144.6 KB
      Views:
      679
  22. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    54

    Hi,
    So now can we use either OneSignal or FCM for Push notifications? Is there any documentation already to take a look at?

    Thanks
     
  23. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
  24. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    Yes! That's true :)
    And we have updated our online documentation which you can access from Unity from menu Window > Easy Mobile > Online Documentation (you probably knew it already :D)
    The relevant chapters are Notifications > Module Configuration > Remote Notifications and Notifications > Scripting.
    Thanks.
     
  25. Mayureshete

    Mayureshete

    Joined:
    Jan 18, 2014
    Posts:
    198
    I want to set Player name as google account login name,
    for example i can set

    void GetPlayerName()
    {

    if (GameServices.IsInitialized())
    {
    playerName = Social.localUser.userName;
    PhotonNetwork.playerName = playerName;
    GoToMainMenu();
    }
    else
    {
    GameServices.Init();
    playerName = Social.localUser.userName;
    PhotonNetwork.playerName = playerName;
    GoToMainMenu();

    }

    }

    but I cant get it done.

    any help here would be appreciated.
     
  26. Mayureshete

    Mayureshete

    Joined:
    Jan 18, 2014
    Posts:
    198
    Nevermind, I got it done. :)
     
    pt5011 likes this.
  27. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    New updates of EM Pro and Basic with the Firebase Messaging support are now available on UAS!
     
    Last edited: Jun 16, 2018
    Mayureshete likes this.
  28. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    54
    Hi,
    Is the documentation updated? I've been opening again and again, hitting refresh and all, but it shows nothing new regarding the FCM, it shows the same content as before :(

    Thanks.
     
  29. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    @noahx yes you should see the updated doc by now
     
  30. indie_dev85

    indie_dev85

    Joined:
    Mar 7, 2014
    Posts:
    51
    Hi,

    I wish to buy easy mobile PRO, will this plugin work with latest Google play services 15.0+.Can you please confirm by testing plugins api with 15.0+ google sdk.
    As i want to incorporate admob 15.0+ sdk now part of play service libraries, having GDPR consent API's.

    Thanks,
    DS
     
  31. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    Hi,

    Thanks for your interest in EM Pro! EM itself doesn't have google-play services as its dependencies. The 3rd party plugins it works with (AdMob, Google Play Games, etc.) are the one who actually require google play services libraries.

    So the short answer is yes :)
     
  32. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    Regarding GDPR, mean time we are working on updating the Advertising modules adding methods that aid with becoming GPDR compliant. Specifically we will add methods to switch between the so called personalized and non-personalized ads so you can serve ads according to the user consent.

    In the near future we aim to provide a more comprehensive solution for this matter (e.g. convenient way to collect consent, simple mechanism to forward the consent to related services, etc.). We'd love to hear your opinions on this issue.
     
  33. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    54
    Hi,
    I implemented the Notifications using FCM but when a message is received it crashes. I can tell the crash happens when the messages arrives to the phone because it happens right after I send the message from the Notification Composer in the Firebase Console.
    Everything seemed fine. It all went smooth in therms of the SDK's, the json file from Firebase that is added to the Assets and the app registering and recognized by FCM.

    Any ideas on where to start to see where the problem might be? The only thing I get when crashes is the "default/generic" message that your app stopped.


    I need to say, my app was already working and receiving notifications using OneSignal (but I'm not a fan of them).

    Thanks.
     
  34. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    @noahx You need to check the device logcat to see what specific exception caused the crash. I recommend using the Logcat debug tool in Android Studio for that.
     
  35. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    54
    Hi,
    Well, first of all and it might sound contradictory but, I'm not a programmer, that's why I'm relying on plugins and other tools that drive me away from coding. Said that, I don't use Android Studio, so I'm not sure what you wanted to get from using that. Even though, I managed to get the logcat from the phone and I searched the name of my app and the name of your module in the hopes of finding something from there, and this is what I found.

    Looks like this portion of the log is right after I opened/started the game, and you can see some lines are trying to initialize Firebase and they throw some errors, including some related to the EasyMobile, so it appears that it was unable to initialize the module/plugin:

    07-02 22:00:45.107 21113 21143 I firebase: Firebase App initializing app .COM.THISISMYAPPPPPPPPPPPPPPPPP (default 1).
    07-02 22:00:45.107 21113 21143 I Unity : Firebase App initializing app .COM.THISISMYAPPPPPPPPPPPPPPPPP (default 1).
    07-02 22:00:45.107 21113 21143 I Unity :
    07-02 22:00:45.107 21113 21143 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
    07-02 22:00:45.107 21113 21143 I Unity :
    07-02 22:00:45.107 21113 21143 I firebase: Firebase Analytics API Initializing
    07-02 22:00:45.107 21113 21143 I Unity : Firebase Analytics API Initializing
    07-02 22:00:45.107 21113 21143 I Unity :
    07-02 22:00:45.107 21113 21143 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
    07-02 22:00:45.107 21113 21143 I Unity :
    07-02 22:00:45.107 21113 21143 I firebase: analytics API Initialized
    07-02 22:00:45.107 21113 21143 I Unity : analytics API Initialized
    07-02 22:00:45.107 21113 21143 I Unity :
    07-02 22:00:45.107 21113 21143 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
    07-02 22:00:45.107 21113 21143 I Unity :
    07-02 22:00:45.107 21113 21143 W System.err: java.lang.NoSuchMethodError: no non-static method "Lcom/google/firebase/messaging/FirebaseMessaging;.subscribeToTopic(Ljava/lang/String;)Lcom/google/android/gms/tasks/Task;"
    07-02 22:00:45.107 21113 21143 W System.err: at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    07-02 22:00:45.107 21113 21143 W System.err: at com.unity3d.player.UnityPlayer.c(Unknown Source)
    07-02 22:00:45.107 21113 21143 W System.err: at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
    07-02 22:00:45.107 21113 21143 W System.err: at android.os.MessageQueue.next(MessageQueue.java:211)
    07-02 22:00:45.107 21113 21143 W System.err: at android.os.Looper.loop(Looper.java:130)
    07-02 22:00:45.107 21113 21143 W System.err: at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
    07-02 22:00:45.107 21113 21143 E firebase: method_ids || method.optional
    07-02 22:00:45.107 21113 21143 E Unity : method_ids || method.optional
    07-02 22:00:45.107 21113 21143 E Unity :
    07-02 22:00:45.107 21113 21143 E Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
    07-02 22:00:45.107 21113 21143 E Unity :

    07-02 22:00:45.107 21113 21143 E firebase: Unable to find Method com/google/firebase/messaging/FirebaseMessaging.subscribeToTopic (signature '(Ljava/lang/String;)Lcom/google/android/gms/tasks/Task;', instance). Please verify the AAR which contains the com/google/firebase/messaging/FirebaseMessaging class is included in your app.
    07-02 22:00:45.107 21113 21143 E firebase: Failed to initialize messaging
    07-02 22:00:45.107 21113 21143 E Unity : Failed to initialize messaging
    07-02 22:00:45.107 21113 21143 E Unity :
    07-02 22:00:45.107 21113 21143 E Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
    07-02 22:00:45.107 21113 21143 E Unity :
    07-02 22:00:45.107 21113 21143 E firebase: Messaging already shut down.
    07-02 22:00:45.107 21113 21143 E Unity : Messaging already shut down.
    07-02 22:00:45.107 21113 21143 E Unity :
    07-02 22:00:45.107 21113 21143 E Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
    07-02 22:00:45.107 21113 21143 E Unity :
    07-02 22:00:45.127 21113 21143 E Unity : InitializationException: Firebase modules failed to initialize: messaging (missing dependency)
    07-02 22:00:45.127 21113 21143 E Unity : at Firebase.FirebaseApp.CreateAndTrack (Firebase.CreateDelegate createDelegate, Firebase.FirebaseApp existingProxy) [0x00000] in <filename unknown>:0
    07-02 22:00:45.127 21113 21143 E Unity : at Firebase.FirebaseApp.Create () [0x00000] in <filename unknown>:0
    07-02 22:00:45.127 21113 21143 E Unity : at Firebase.FirebaseApp.get_DefaultInstance () [0x00000] in <filename unknown>:0
    07-02 22:00:45.127 21113 21143 E Unity : at Firebase.Messaging.FirebaseMessaging+Listener..ctor () [0x00000] in <filename unknown>:0
    07-02 22:00:45.127 21113 21143 E Unity : at Firebase.Messaging.FirebaseMessaging+Listener.Create () [0x00000] in <filename unknown>:0
    07-02 22:00:45.127 21113 21143 E Unity : at Firebase.Messaging.FirebaseMessaging..cctor () [0x00000] in <filename unknown>:0
    07-02 22:00:45.127 21113 21143 E Unity : Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Firebase.Messaging.FirebaseMessaging

    07-02 22:00:45.127 21113 21143 E Unity : at EasyMobile.Notifications.Init () [0x00000] in <filename unknown>:0
    07-02 22:00:45.127 21113 21143 E Unity : at EasyMobile.Notifications+<CRAutoInit>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0

    07-02 22:00:45.127 21113 21143 E Unity : at UnityEngine.SetupCoroutine.Invok

    And later in the log, there are some lines that look like it was the moment the notification was received and the crash reported to the screen:

    07-02 22:02:27.557 21113 22135 E AndroidRuntime: FATAL EXCEPTION: Firebase-ListenerService
    07-02 22:02:27.557 21113 22135 E AndroidRuntime: Process: .COM.THISISMYAPPPPPPPPPPPPPPPPP, PID: 21113
    07-02 22:02:27.557 21113 22135 E AndroidRuntime: java.lang.Error: FATAL EXCEPTION [Firebase-ListenerService]
    07-02 22:02:27.557 21113 22135 E AndroidRuntime: Unity version : 2018.1.2f1
    07-02 22:02:27.557 21113 22135 E AndroidRuntime: Device model : samsung SM-G920V
    07-02 22:02:27.557 21113 22135 E AndroidRuntime: Device fingerprint: Verizon/zerofltevzw/zerofltevzw:5.0.2/LRX22G/G920VVRU1AOC3:user/release-keys
    07-02 22:02:27.557 21113 22135 E AndroidRuntime:
    07-02 22:02:27.557 21113 22135 E AndroidRuntime: Caused by: java.lang.AbstractMethodError: abstract method "void com.google.firebase.iid.zzb.zzd(android.content.Intent)"
    07-02 22:02:27.557 21113 22135 E AndroidRuntime: at com.google.firebase.iid.zzc.run(Unknown Source)
    07-02 22:02:27.557 21113 22135 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    07-02 22:02:27.557 21113 22135 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    07-02 22:02:27.557 21113 22135 E AndroidRuntime: at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source)
    07-02 22:02:27.557 21113 22135 E AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
    07-02 22:02:27.577 3580 3621 V ApplicationPolicy: isApplicationStateBlocked userId 0 pkgname .COM.THISISMYAPPPPPPPPPPPPPPPPP

    07-02 22:02:27.587 3580 3580 D CrashAnrDetector: processName: .COM.THISISMYAPPPPPPPPPPPPPPPPP
    07-02 22:02:27.587 3580 3580 D CrashAnrDetector: broadcastEvent : .COM.THISISMYAPPPPPPPPPPPPPPPPP data_app_crash

    07-02 22:02:27.597 17959 17959 I LoadedApk: getClassLoader :dalvik.system.PathClassLoader[DexPathList[[zip file "/system/priv-app/Amazon_Appstore/Amazon_Appstore.apk"],nativeLibraryDirectories=[/system/priv-app/Amazon_Appstore/lib/arm, /vendor/lib, /system/lib]]]
    07-02 22:02:27.597 3580 3621 W ActivityManager: Force finishing activity .COM.THISISMYAPPPPPPPPPPPPPPPPP/com.google.firebase.MessagingUnityPlayerActivity
    07-02 22:02:27.597 3580 3621 D FocusedStackFrame: Set to : 0


    I'm not sure if that helps.
    I checked the confirmation of the plugin installation for Firebase in the EasyMobile settings stating that it is imported and ready to use (and of course the package was imported and it is present).

    Thanks.
     
  36. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    @noahx Thanks for posting the log. So it looks like the native libraries for Firebase Messaging were missing. Please try this:

    - Reimport FirebaseMessaging plugin.
    - Go to menu Assets > Play Services Resolver > Android Resolver > Force Resolve
    - Wait until the resolution completes (make sure it doesn't report any error) then rebuilds.

    Hope this helps.
     
  37. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    54
    Hi,
    Me again, sorry. I tried reimporting the Firebase Messaging plugin and did the Force Resolve thing (it took a long time) but no errors once it finished, but after building a new app, it kept crashing the same way.
    But anyway, I made the decision to simply go back to OneSignal and to deal with it. So I changed the option in the EasyMobile settings back to OneSignal instead of the Firebase that was set. I built the app again and I tested it sending a message using OneSignal messages and the app crashed again (I was already working with OneSignal before switching to Firebase).
    I noticed in the logs that no matter that I switched EasyMobile to use OneSignal, the app for some odd reason was still trying to load Firebase. So, I had to go back to my latest project backup of a few days prior importing Firebase and the updated EM plugin and OneSignal is working again and I had to redo some of my apps changes that were lost by rolling back to the previous version of the project.

    So, I jumped to follow your recommendation you wrote some weeks ago but it is not working as expected, I mean, OneSignal is still getting the information of the user/phone no matter what, so I was wondering if maybe in the initialization of your plugin there's somewhere the UserConsent to true overriding everything. Here's what you suggested, just as a reminder:

    We're investigating this issue, not just notifications but also ads and other services.

    In the mean time, we propose the following workflow:

    1- Disable Easy Mobile's auto-init for the Notifications module.
    2- Call OneSignal.SetRequiresUserPrivacyConsent(true); to delay the initialization of OneSignal SDK until the user provides consent
    3- Call EasyMobile.Notifications.Init to initialize the module (so local notifications work), OneSignal as mentioned will delay itself
    4- Use OneSignal.PromptForPushNotificationsWithUserResponse(callback) to prompt for user consent using the default system prompt (iOS only) or build your own dialog to collect user consent.
    5- Once the user consent is collected, call OneSignal.UserDidProvideConsent(true); so OneSignal can finish its initialization.


    So here's what I did, numbered as steps to reference your comments above(in green)(the debugchain you see is a string I build of the methods that are being called and then I display that string on screen, to see what was called and in what order):
    1 - EasyMobile auto-init is disabled:

    2 - I'm Calling the SetRequiresUserPrivacyConsent(true)

    Code (CSharp):
    1. public void prepareonesignal()
    2.     {
    3.         debugchain = debugchain + " >>> prepareonesignal >>>   ";
    4.         OneSignal.SetRequiresUserPrivacyConsent(true);
    5.         debugchain = debugchain + " || " + "OneSignal.SetRequiresUserPrivacyConsent(true);";
    6.     }
    3 - I'm "manually" initializing EasyMobile:

    Code (CSharp):
    1. public void getlocalnotifications()
    2.     {
    3.         debugchain = debugchain + " >>> EasyMobile.Notifications.Init(); >>>   ";
    4.         EasyMobile.Notifications.Init();
    5.     }
    4 - I'm using Android. I have my own dialog but I always say NO (not giving consent) so the app does nothing more regarding Consent or anything.

    5 - Even though, here it is the method that would be called in the case of a YES (but it is not being called in this case because I even disabled the call to force it to never give consent)

    Code (CSharp):
    1. public void preparefullnotify()
    2.     {
    3.         debugchain = debugchain + " >>> preparefullnotify >>>   ";
    4.         OneSignal.UserDidProvideConsent(true);
    5.         debugchain = debugchain + " || " + "OneSignal.UserDidProvideConsent(true);";
    6.     }
    So, while logged in the OneSignal website, there are no users/phones/devices registered, I open the app, create a profile and I say NO (but the method to give consent is never called anyway), then I refresh the OneSignal website and all the info of my phone is there :(

    This is the "Debug Chain" just to show the order of execution of the methods when the app runs on a phone that is not registered in the OneSignal website and then it ends being registered with OneSignal when it was supposed not to:

    >>> prepareonesignal >>> || OneSignal.SetRequiresUserPrivacyConsent(true); >>> EasyMobile.Notifications.Init(); >>>

    Am I doing something wrong? is it right the order of execution? maybe in your Init method there's an instruction to give consent?

    Thanks again. And sorry for writing the whole story.
    Noah.
     
  38. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    @noahx Thanks for the detailed explanation. We generally prefer more information than less because that tends to help resolve problems quicker.

    Regarding Firebase, (I know you've switched back to OneSignal but it's worth discussing it to find the cause of the problem), after the resolution did you have the following files (versions may vary a bit) in your Assets/Plugins/Android folder?

    Screen Shot 2018-07-04 at 5.50.58 PM.png

    I've exported them into a unitypackage, so if you still want to do a quick test try importing it into Assets/Plugins/Android, remove any duplicate files if any and rebuild.

    Regarding OneSignal: maybe the FirebaseMessaging SDK somehow initialized its native client on its own and tried to handle the incoming push notification causing the crash.

    We don't call OneSignal.SetRequiresUserPrivacyConsent(true); and OneSignal.UserDidProvideConsent(true); anywhere in EM code. You can check the initialization code for OneSignal in the Notifications.cs script.

    So when you select NO in the consent dialog, did you call OneSignal.UserDidProvideConsent(false);? I believe that's necessary and according to OneSignal doc the SDK won't be fully initialized until the method is called. Your debugchain doesn't show it anywhere.
     
  39. CoderPro

    CoderPro

    Joined:
    Feb 21, 2014
    Posts:
    314
    Game crash when call login google play game services. I am using Unity 2018.2.0f1 and Google Play Game Services 0.9.50
     
  40. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    @CoderPro Thanks for using our plugin.

    Can you share the crashlog? As a first aid:

    - make sure the XML resources was properly entered into EM Settings, and the 'Setup Google Play Games' completed without error.
    - try Assets > Play Services Resolver > Android Resolver > Force Resolve, make sure the resolution completes without errors and rebuild.
     
  41. Mayureshete

    Mayureshete

    Joined:
    Jan 18, 2014
    Posts:
    198
    hello, I turned on ads in my game android. unity 5.6

    here is the code
    Code (CSharp):
    1.  
    2.  
    3. bool isReady = Advertising.IsInterstitialAdReady();
    4.  
    5.             // Show it if it's ready
    6.             if (isReady)
    7.             {
    8.                 Advertising.ShowInterstitialAd();
    9.                
    10.             }
    11.             else
    12.             {
    13.                 Debug.Log("<color=red>Here is the error:</color> Ads not ready");
    14.             }
    15.  
    16.  
    I am getting error ads not ready any help...
    I have also attached the easymobile settings image
     

    Attached Files:

  42. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    54
    Hi,
    Are you to testing in the Unity Editor or are you testing it on your mobile? Ads will never show up in Unity's editor. You must build an APK file for your phone.

    As a suggestion, in case you're indeed testing on your phone, you should verify that the module is initialized (the whole module).
    Also try to load ads manually to see if something changes.
    And finally, this is not specific of the EasyMobile plugin but, try disabling and enabling back the Unity Ads Service (Window->Services) and reload Unity. Those services behave funny at times.

    I hope it helps.
    Noah.
     
    pt5011 likes this.
  43. Mayureshete

    Mayureshete

    Joined:
    Jan 18, 2014
    Posts:
    198
    i tested on both , but its saying ads not loading.

    also in console is showing

    UnityAdsEditor: Initialize(1xxxx5, True);
    UnityEditor.Advertisements.UnityAdsEditor:EditorOnLoad()

    when starting game
     

    Attached Files:

  44. EyeOfDBeholder

    EyeOfDBeholder

    Joined:
    Jun 6, 2013
    Posts:
    4
    Hey everyone, first of all, I love this asset, one of the best investments I could have made! So, I have implemented google play games only to find out that in some devices it won't start. I've tested on Android 6,7 and 8, all goes well on my devices but several people running the same OS aren't. So I managed to get my hands on a conflicting phone and everytime I try to login it crashes with the following log:


    DllNotFoundException: Unable to load DLL 'gpg': The specified module could not be found.
    at GooglePlayGames.Native.Cwrapper.Builder.GameServices_Builder_Construct () [0x00000] in <filename unknown>:0
    at GooglePlayGames.Native.PInvoke.GameServicesBuilder.Create () [0x00000] in <filename unknown>:0
    at GooglePlayGames.Native.NativeClient.InitializeGameServices () [0x00000] in <filename unknown>:0
    at GooglePlayGames.Native.NativeClient.Authenticate (System.Action`2 callback, Boolean silent) [0x00000] in <filename unknown>:0
    at EasyMobile.GameServices.Init () [0x00000] in <filename unknown>:0


    So browsing the only solution I came across was to reimport the latest google games plugin and then force resolve but that doesn't do the trick, the fact is, I exported to android studio and the *.aar file is there but of course, no such thing as a gpg module but the file is with the rest of the libraries. One would assume it wouldn't matter since on the gradle.build file I have this
    compile(name: 'com.google.games.gpgs-plugin-support-0.9.50', ext:'aar')
    I even tried copying an old libgpg.so to my plugins/android folder but of course, no dice.

    So, any ideas? I'm out of ideas and the solutions provided so far are all unsuccessful...
     
  45. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    Hi @Mayureshete ,

    So you're testing using the demo app correct?

    - What EM version are you using?
    - What Unity version is it?

    Please pay attention to a few things:

    - Make sure the EasyMobile prefab was added to DemoHome scene or to AdvertisingDemo scene.
    - In Unity Ads service window, expand the Advanced section and make sure the "Enable built-in extensions" is checked.
    - Try enable/disable test mode of Unity Ads (in Services window too).
    - Check your Unity Ads dashboard to see if there're any requests made from the app. If there're some requests but no matched requests it's a fill rate issue. If there's no request then something went wrong with the app and we'll need to double check the settings, etc.
     
  46. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    Hi,

    Interesting issue. So it actually run fine on your phones but crashed on some others? Do you have info of what specific devices are they and their Android versions? What about the conflicting phone that you have access to?

    And I guess you already checked this out? https://github.com/playgameservices/play-games-plugin-for-unity/issues/2028

    - Have you tried disabling stripping in Unity?
    - Did the play services resolver report any error after force resolving?
    - Is it a must to build from Android Studio? Maybe it's worth a try to build directly in Unity and see if there's any difference? If the APK can't be built in Unity because of the multidex issue you can start a new project with only EM and GPGS and build an app from our demo scenes, should be sufficient for testing purposes.
     
  47. Mayureshete

    Mayureshete

    Joined:
    Jan 18, 2014
    Posts:
    198
    m using easy mobile 1.2.1 & unity 5.6.0F3

    In test Mode
    UnityAdsEditor: Initialize(1411175, True);
    but when i disable testmode it turns to false.

    • I have easymobile prefabs
    • advanced section in unity ads service the enable builtin extension is checked
    • tried enabling and disabling the test mode mentioned above
    • Somehow M not able to check the requests in my ads dashboard if someone can guide me.
     
  48. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    Is it possible to test with a more recent version of Unity? Like 2017 or 2018? Note that you can install multiple versions of Unity on one machine.

    Also always test on real devices.
     
  49. Mayureshete

    Mayureshete

    Joined:
    Jan 18, 2014
    Posts:
    198
    i have tested it in my other game on 2018.2, unity ads on its own without easy mobile works fine, but wont work with easymobile.
     
  50. pt5011

    pt5011

    Joined:
    Aug 7, 2015
    Posts:
    403
    Well, it's a bit disheartening hearing that. Would it be possible to share a minimized project that suffers from the issue to support@sglibgames.com so we can take a look? Thanks.
     
unityunity