Search Unity

  1. 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
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

NATIVE PLUGINS for Unity: iOS, Android [Billing, Cloud Save, Game Services, Webview, Sharing & More]

Discussion in 'Assets and Asset Store' started by Voxel-Busters, Apr 4, 2015.

?

Do you want to see Windows Mobile support in CPNP? FYI, current market share is less than 3%.

Poll closed Dec 25, 2015.
  1. Ooh la la, Love to see that!

    52.2%
  2. I don't give a damn!

    26.1%
  3. Are you crazy! Who makes games for Windows Mobile.

    21.7%
  1. zkaiser

    zkaiser

    Joined:
    Feb 22, 2014
    Posts:
    12
    Here is the log picking image from gallery and from camera.
     

    Attached Files:

    • log.txt
      File size:
      14.2 KB
      Views:
      635
  2. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    @zkaiser Checked the log but nothing wrong I found. I see the log got filtered. Could you please send me more informational log (adb logcat > log.txt) ?
     
  3. zkaiser

    zkaiser

    Joined:
    Feb 22, 2014
    Posts:
    12
    Of course!

    Edit: I think the problem was the size of the images I was trying to pick. With lower resolution images I think it is working. Let me give it a try. I will tell you.
    Anyway, thank you very much.
     

    Attached Files:

    • log.txt
      File size:
      899.3 KB
      Views:
      2,448
    Last edited: Oct 4, 2015
  4. plokkum

    plokkum

    Joined:
    May 28, 2013
    Posts:
    78
    A default feature I would like to request is a callback from RateMeNow, with the option the player chose. I know it is possible to create your own dialogs with ShowAlertDialogWithMultipleButtons, but it would implementation be a little quicker.
     
    Voxel-Busters likes this.
  5. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    @plokkum We have plans for revising the RateMyApp feature by providing callbacks.

    Note : If anyone is facing issues related to Game Services Login on "Samsung" Devices, Please mail our support for the fix.

    There is an issue with Samsung's JSON toString implementation which is returning a plain string instead of maintaining JSON format.

    *And this is not seen on all Samsung devices.

    Thanks,
    VB Team.
     
  6. Robota

    Robota

    Joined:
    Feb 7, 2012
    Posts:
    82
    Hi Voxel Buster, I used your plugin exclusively to handle push notifications on multiple plateforms.
    For now, I' am trying to make it works on iOS but I got this exception :

    NullReferenceException: A null value was found where an object instance was required.
    at VoxelBusters.DebugPRO.Console.ClearConsole () [0x00000] in <filename unknown>:0
    at VoxelBusters.DebugPRO.Console.Log (System.String _tagName, System.Object _message, eConsoleLogType _logType, UnityEngine.Object _context, Int32 _skipStackFrameCount) [0x00000] in <filename unknown>:0
    at VoxelBusters.NativePlugins.NotificationService.DidRegisterRemoteNotification (System.String _deviceToken) [0x00000] in <filename unknown>:0

    It is your custom console that is crashing in file NotificationService.Events.cs in the method DidRegisterRemoteNotification().

    I have commented this line of code (line 111):
    Console.Log(Constants.kDebugTag, "[NotificationService] Remote notification registration finished, DeviceToken=" + _deviceToken);

    And it worked.

    Do you understand what could be the cause of the problem? Can you help?
    Thanks
     
  7. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Thanks for reporting! Actually its the second similar issue reported today :( And currently we are not aware of the reason for this crash nor able to reproduce it. So we need your help on this.

    Can you please share info about Unity version being used. And also may I know whats setting used for Stripping Level and Script Call Optimisation in iOS Player Settings.
     
  8. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    301
    Hi there,

    Is there's a way for me to validate purchases of non-consumable without relying on my own server? Say, like getting the purchase information directly from Google or Apple? I've used Unibill before, and this doesn't seem to be possible.
     
  9. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    By default CPNP provides validation on client side on Android and optionally can validate with your own server or with Apple server on iOS. Is that what you are looking for?

    Additionally, if you want to validate the receipt on Android in your own server, required info is provided in the transaction response.
     
  10. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    301
    I'm mainly working on Android.

    I'm not clear about the validation on client side, does this means that it validates using local data/cache/playerprefs? If so, then that means whenever the user clears the cache then the information would always return false for IAP is it?

    I don't have a server setup (budget lacking), my previous experience is that when I tried to repurchase non-consumables then it will return a fail state (even after cache was cleared). I was thinking whether the validation/restoration of IAP can be done by using this information returned from the Google Play Store when I want to query the purchase.

    Hope my explanation makes sense :)
     
  11. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Ok, I think I wasn't clear enough in my previous message. Please let me explain.

    No. It uses the public key you set in NPSettings->Billing->Android section and checks for the validity of the purchase.
    Nothing is saved in the cache. Non-Consumables info is stored on google servers automatically after the purchase. This makes it easier to retrieve info for "restore purchases" call. Where as consumables will not be stored anywhere.

    In Short, You don't need to save any info related to the purchases for non-consumable. If you see its a new installation by the same user, just call restore purchases and it should retrieve the info for the account and give you the callback.

    Please let us know incase if you need further information or anything needs clarification.
     
  12. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    301
    That's good to know. I will definitely consider buying CPNP over the others. Thanks :)
     
  13. Robota

    Robota

    Joined:
    Feb 7, 2012
    Posts:
    82
    Hey,
    The version of Unity is 5.2.1f1 Personnal.
    The Stripping Level : I build with IL2CPP with strip engine code enabled.
    And finally the script code optimisation is : Slow and Safe.

    I hope it will help you to help me ;)
     
  14. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Thanks for sharing the information. We will try to reproduce this issue and find out the the reason for this strange crash :( Anyways will keep you updated regarding it.
     
  15. leekinon

    leekinon

    Joined:
    Dec 4, 2013
    Posts:
    21
    I just add some code in the plugin which make the IOS app can share video in whatsapp. It can work on old whatsapp version but fail in new whatsapp version. Is there are something change in new whatsapp version? I use
    const char* type to pass the video path from c# to objective c. Is it right?

    ps: I use the Lite version.
     
  16. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    We didn't try with sharing video yet, but you are doing it right. you can refer code related to the share image ( We are passing byte array I suppose) for getting on how to pass strings.

    Thanks,
    VB Team.
     
  17. leekinon

    leekinon

    Joined:
    Dec 4, 2013
    Posts:
    21
    Thanks.One more question:
    How to have a call back after finish whatsapp sharing?
     
  18. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Cache the completion callback in OnSharingFinished event and call
    Code (CSharp):
    1. UnityPlayer.UnitySendMessage("NPBinding", "WhatsAppShareFinished", ""); //On Android.
    2. UnitySendMessage("NPBinding", "WhatsAppShareFinished", "");  //On iOS
    3. // Here NPBinding is the game object name and WhatsAppShareFinished is the method name.
     
  19. leekinon

    leekinon

    Joined:
    Dec 4, 2013
    Posts:
    21
    I still have a problem in sharing video in the new version whatsapp. There are a new page in the new version before sharing video which make me cannot share video.
    IMG_0283.PNG
    IMG_0284.PNG
     
    Last edited: Oct 14, 2015
  20. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    As I informed you earlier, we didn't try on sharing video yet. So, can't comment on what is wrong here.
    However, the way you are passing string to native seems fine. I see a restriction of 16MB for whats app. Make sure you won't exceed it and give a try with a small different format video file once.

    Additionally, I would request to mail our support team so, its easy for others as well to check for updates on this forum thread.
     
  21. Crillst

    Crillst

    Joined:
    Dec 29, 2013
    Posts:
    69
    Hi!

    Looks like the callbacks have stopped working on ios 9, my code looks like this:

    Code (CSharp):
    1.        
    2. NPBinding.Sharing.ShareScreenShot("I scored " + score  + " in Friendsheep. http://honkbarkstudios.com/games/friendsheep/" , this.excludedOptions, this.FinishedSharing);
    3.     }
    4.  
    5.    private void FinishedSharing (eShareResult _result) {
    6.         SheepGameEnder.Instance.ShowMenu();
    7.     }
    8.  
    But FinishedSharing() never gets called on ios. however it does work on android.
     
  22. Simon_says

    Simon_says

    Joined:
    Oct 19, 2013
    Posts:
    141
    Any news regarding this?)
     
  23. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Yes you are right! Even we noticed that sharing feature callback had stopped working in iOS 9 devices. Anyways we are glad to inform that we have already fixed this issue and new version v1.2.1 will include this fix.

    FYI, new versions v1.2 and v1.2.1 are submitted to asset store and soon it will available for download after its done with review.

    Incase if you need it urgently, then please drop a mail to support@voxelbusters.com along with your invoice details and we would be happy to share this new package.
     
  24. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Here's an update regarding this product:

    Honestly, product is not yet ready and it still needs some more time for refining and testing out functionalities. So as soon as the product enters Beta phase, we will share more details about the product and also about its release.
     
  25. Robota

    Robota

    Joined:
    Feb 7, 2012
    Posts:
    82
    Does the crash on the console object is fixed ?
     
  26. Crillst

    Crillst

    Joined:
    Dec 29, 2013
    Posts:
    69
    Sweet! Thanks!
     
    Voxel-Busters likes this.
  27. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Sorry to say, but we couldn't reproduce this issue until now. Actually we dint come across it, so issue might still exist in next version as well :(
     
  28. jprocha101

    jprocha101

    Joined:
    Apr 8, 2015
    Posts:
    134
    @Voxel Busters Hi - Is there a way to return a list of transactions previously completed using the Billing functionality?

    I am trying to get a list of all transactions so I can restore a user's purchases if they switch device or reinstalls the app, for my game they purchase a number of Hints which are used to help solve a puzzle. I am currently saving the list of transaction ID's in the player prefs. So I will compare all completed transactions to the list in player prefs, if it is not in player prefs then that means the product will need to be restored and the ID saved into the player prefs so the cannot restore again.

    If there is a better way to do this please let me know. Thanks!
     
    Last edited: Oct 20, 2015
  29. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Hi Rocha,
    Based on the funtionality you explained, it looks you have non-consumable products.

    You can easily restore them any time with NPBinding.Billing.RestoreCompletedTransactions call. Make sure you listen to transactions event.

    It's recommended to have restore purchases button to let user restore his purchases on iOS. Else its subjected to rejection in review process.
     
    Last edited: Oct 21, 2015
  30. jprocha101

    jprocha101

    Joined:
    Apr 8, 2015
    Posts:
    134
    @Voxel Busters
    Hi - The items could be viewed as consumable as well - the user will purchase a specified number of hints, use them and then can purchase more. It seems like a grey area since the hints are consumed, but not immediately.

    Anyway, I have the callback method TransactionFinishedEvent set and it is executed when RestoreCompletedTransactions is called, but I do not get any transaction returned. The returned IList _finishedTransactions is always empty.

    I am only in the beta testing phase so my test users have purchased (without being charged) items but there is nothing returned from the method call. Could it be because the APK is still in beta? Or is this only possible with non-consumable items, I would assume I could get a list of transactions for the user whether it is consumable or not?

    Also, this is for Android so the in app purchase items are setup as Managed.
     
    Last edited: Oct 21, 2015
  31. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Ok.
    Restore works only for non-consumable products by design. Apple/Google save data about non-consumable transactions alone.

    So, incase if you want to save info about consumable products, only option I see is to save in your server as a part of player profile data or go for cloud save.

    On Android, as you marked consumable, we consume the managed product on purchase automatically.


    Thanks,
    VB Team.
     
    Last edited: Oct 22, 2015
    jprocha101 likes this.
  32. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Hi Guys,
    New version 1.2.1 got approved and available on Asset Store. We made some changes to the callbacks for giving more information to the developers. We will soon update the tutorials as well with the changes and remove deprecated methods.

    1.2.1
    Important: Delete package folders before updating.

    - Implemented a new system, which makes it possible for user to remove unused features completely.
    - Mail sharing now includes 2 new fields CC and BCC recipients.
    - BillingProducts includes currency code and currency symbol.
    - Added menu item for uninstalling plugin which can be used before importing an update.
    - Sign out added for Game Services. On iOS it just ignores the call as its not possible to signout.
    - [iOS] Native files are hard copied to exported build, in order to avoid compilation issues caused by moving files.
    - [Android] Vibration setting optional for notifications. Now can enable/disable from NPSettings.

    - GameServices: Callback now includes error description information.
    - GameServices: Included Global Identifier support for easy access of Leaderboard and Achievement objects.
    - Billing: Existing callbacks are deprecated. Use the new one instead.
    - Billing: Included new static API to create product at runtime.
    - Sharing: Existing API's are deprecated. Now it makes use of composer object for accessing sharing functionality.
    - NPSettings: Changed interface to provide better user experience.
    - Macro Symbols are now added to player settings for supporting Cloud builds.
    - Option to place plugin resources under Assets/PluginResources/NativePlugins for each platform.
    - Demo scenes provides info about key points related to feature usage.
    - [Android] NetworkConnectivity: Changed from ping to socket connection. Now it expects a port number inNPSettings.
    - [Android] Notification images & sounds no more uses Streaming assets and deprecated. Place your resources under Assets/PluginResources/NativePlugins/[Android / Common] folder.

    - [MediaLibrary] Exif data considered for images which are picked from Library and handled automatically.
    - [iOS] Fixed major bug related to IAP validation.
    - [iOS] Fixed notification issues.
    - [iOS] Share intent window is not showed for sharing using FB or Twitter only.
    - [iOS] Not using Unity's implementation anymore for Notification and Game Center feature.
    - [Android] Fixed load Data call forwebview.
    - [Android] Fixed JSON conversion crashes on Samsung and HTC devices.
    - [Android] Fixed Notification custom sound volume.
    - [Android] Fixed stop video callback for youtube play.
    - [Android] Fixed Raw purchase data for Billing Transaction.
    - [Android] Fixed Ping access failure on Samsung Galaxy devices.
    - [Android] Fixed Twitter SDK crash on pressing cancel while logging in.


    On updating, you will see some deprecated warnings which are recommended to update to new API and please check demo scripts for reference meanwhile. Some callbacks may expect new parameters just to provide ease for developer (for error information incase of any failures).

    Thanks,
    VB Team.
     
    Crillst likes this.
  33. jprocha101

    jprocha101

    Joined:
    Apr 8, 2015
    Posts:
    134
    @Voxel Busters
    Is Google Saved Games via Play Games Services available or do you guys have plans of implementing it? Also, multi player functionality is missing. I do not know if iOS Game Center has an equivalent, but technically Play Games Services runs on iOS too :)

    Thanks!
     
  34. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    We will be starting on design of Cloud save feature from coming week. We are looking for user feedback on finding out the scope of it. Something like, can it be limited to cloud player prefs or uploading files also should be allowed. Any suggestions are appreciated.

    Coming to multiplayer, it needs lot of testing and time investment as you are aware. So, we didn't decide on it yet as a part of feature set. Currently, our goal is to finish the cloud save and Amazon support as soon as possible. Adding to it, We have some few minor requests in the current feature set (RateMyApp callbacks, notifications on reboot, etc...), so we will get it done as well where ever applicable.

    Thanks,
    VB Team.
     
    jprocha101, Crillst and Cromfeli like this.
  35. Crillst

    Crillst

    Joined:
    Dec 29, 2013
    Posts:
    69
    Thanks.
    I've tested the sharing abilities on ios9 and it works like a charm!
     
    Voxel-Busters likes this.
  36. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    This looks like a great and well thought out update! Thanks for creating such a great asset. One comment would be to create a better set of tutorials on your site if possible, they are currently not up to date.
     
    Voxel-Busters likes this.
  37. plokkum

    plokkum

    Joined:
    May 28, 2013
    Posts:
    78
    @Voxel Busters NPBinding.Utility.OpenStoreLink will refer to the "Apple ID" under "App Information" in iTunesConnect, correct? Thanks a lot for version 1.2.1, by the way!
     
  38. plokkum

    plokkum

    Joined:
    May 28, 2013
    Posts:
    78
    By the way, I can't find NetworkConnectivity anymore after the last update.

    Edit, I fixed that by reinstalling the plugin, deleting all the plugin files. However now GameServices.LocalUser cannot be found @Voxel Busters .
     
    Last edited: Oct 24, 2015
  39. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    @mimminito : We will work on tutorials this weekend. We should be ready by Sunday night!
    @plokkum : You can see the LocalUser variable in Game Services even you get this error. This means something else is halting the compilation of these scripts. Can you mail us complete error log?
     
  40. plokkum

    plokkum

    Joined:
    May 28, 2013
    Posts:
    78
    Update: It took me a while, but I managed to fix it by:

    1) Deleting every single file that is associated with CPNP. It turns out the "Uninstall" feature leaves some remains - either that, or the initial update procedure (according to the folder structure blog post) was not sufficient initially.

    2) Then I commented out every reference to NPBinding and the Voxel Buster namespace. I think this was important in order for the script to be able to configure itself.

    3) I quit Unity just to make sure there are somehow no references in the memory - I'm not sure if this happens at all, but just to be safe.

    4) Import the new update.

    5) Enable all references to NPBinding/VoxelBuster again.

    I hope this helps others if any errors may occur.

    And as always, thanks for the help and quick response time, @Voxel Busters. I will email you the log file in a few minutes.
     
    Voxel-Busters likes this.
  41. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Hi,
    For developers who are facing the compilation issue on updating the plugin, Let me first explain the reason behind it and the working solution.

    Reason
    • Now we use defines in Player Settings to avoid exporting code & frameworks of unused features. This was highly recommended and requested from the developer community.
    • So, as the new code is under macro defines, once after import, compilation may fail because of the defines not being in Player Settings.
    • Our automated scripts will handle it but its not getting a chance to compile because of other compilation errors in the project (I think you got what we mean here).
    • Game Services now expect extra parameter in the callbacks. Just add "string _error" parameter to your callback prototypes. This extra flag gives good information for the failure of any api calls.
    Solution
    After deleting the existing plugin folders , Please just do the below step.
    Just append the above text to your "Player Settings-> Other Settings -> Script Define Symbols". This forces our scripts to compile and it should resolve the issue. Once our scripts compile, it will take care of used/unused features and updates accordingly as per your NPSettings done earlier. After this make sure you fix the Game Services callback changes.


    Please confirm if any one tries this solution.
     
    Last edited: Oct 24, 2015
  42. plokkum

    plokkum

    Joined:
    May 28, 2013
    Posts:
    78
    I'm not sure why this started happening after updating the plugin, but even though GameServices is logging me in (My player information appears in XCode's log), according to GameServices I'm not authenticated.

    Besides that, the localUser.Authenticate's callback is not being called on my mobile device, which is connected to the internet. GameCenter is also enabled in iTunesConnect and it used to work before the update.

     
  43. Robota

    Robota

    Joined:
    Feb 7, 2012
    Posts:
    82
    Hi Voxel Buster,
    I'am trying to get a valid format for the payload of my push iOS notifications.

    I use the "Push Notification" debug button in the editor to test my code. I enter this json:

    Code (json):
    1.  
    2. {
    3.     "aps": {
    4.         "alert" : {
    5.             "body" : "bla bla",
    6.             "action-loc-key" : "VIEW"
    7.         },  
    8.         "sound":"notification.mp3"
    9.     },  
    10.     "user-info": {
    11.         "key1":"value1",
    12.         "key2":"value2"
    13.     }
    14. }
    But I can not get the user-info part. The UserInfo member in CrossPlatformNotification is null.
    I don't get it...
     
  44. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Hello @Robota

    In iOS platform, key used to fetch user data (user info) is customisable and you can configure this value in NPSettings->Notification Settings. And btw, default for this key is: user_info.

    Whereas in above payload, user-info key holds user data, which is slightly different from default key value. So can you please confirm whether you have added user-info as key in NPSettings as well?
     
  45. Robota

    Robota

    Joined:
    Feb 7, 2012
    Posts:
    82
    Thanks Voxel Buster,
    You'r right the problem was the key. It is not "user-info" as the documentation say (!) but "user_info".
     
    Voxel-Busters likes this.
  46. jprocha101

    jprocha101

    Joined:
    Apr 8, 2015
    Posts:
    134
    Personally I would be using Cloud save mostly for player prefs giving the user the ability to save progress across multiple devices. A simple method call to upload/retrieve all prefs for the logged in user would be perfect.

    I'm sure other developers use something other then player prefs so file uploads would benefit them.
     
    Voxel-Busters likes this.
  47. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    @jprocha101 Thank you very much for your suggestion. We really appreciate the time you took to think about it and we find it to be very helpful.

    Also, requesting others to share their opinion as well. Your suggestion will help us better in defining the scope for this new feature. So please don't hesitate to share your thoughts.
     
    Last edited: Oct 27, 2015
    jprocha101 likes this.
  48. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Guys, Did you check our new NPSettings? What do you think about it? We hope you will engage with us in improving the product by sharing your views and suggestion.

    Thanks
    VB Team
     
    plokkum likes this.
  49. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Its a much nicer layout, but I do have some issues. With the new pack the "us" file inside the Assets causes a permanent error in the project, I have to delete it and reimport all assets from the menu.
     
  50. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    898
    Hello @mimminito, thanks for the feedback.

    Sorry, we din't get the issue that you just mentioned. Can you please share more info about it.
     
unityunity