Search Unity

NATIVE PLUGINS for Unity: iOS, Android [Need Prime31 / Easy Mobile / Stans Assets replacement??]

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 Aug 26, 2022.
  1. Ooh la la, Love to see that!

    12 vote(s)
    52.2%
  2. I don't give a damn!

    6 vote(s)
    26.1%
  3. Are you crazy! Who makes games for Windows Mobile.

    5 vote(s)
    21.7%
  1. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Well, we don't collect any kind of personal information. Even for our billing, we don't have dependency with any analytics making it privacy-first plugin and is a great option for devs who make games for kids!

    We are just an interface to native and how you use the information you retrieve from our plugin is what you need to declare in your terms. We don't store any or save pass data to anywhere outside of your game/app.

    For ex: If you use Game Services feature with email scope (which is optional), you need to indicate in your terms how you are using the email id.
     
  2. zhangkun907

    zhangkun907

    Joined:
    May 17, 2022
    Posts:
    6
    upload_2022-8-12_12-8-50.png
    upload_2022-8-12_12-9-24.png

    Why is the native ui plugin enabled when I enable deep link?
     
  3. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Actually, Native UI is enabled by default as we use it for many other features internally (for ex: showing confirmation dialog for rate app or any other alerts if required). The impact(build size) is nearly negligible so we enable it by default.

    Please share us if you have any feedback for it so that we can review it.
     
  4. GustavNinja

    GustavNinja

    Joined:
    Jun 13, 2016
    Posts:
    96
    Hi I'm currently using an older version (1.5.7p4) of Voxelbusters and I'm upgrading from 2019.4 to 2020.3. However I'm having a problem with getting the gradle to work since it's not adding Voxelbuster files to my apk.
    What changes do I need to do to make it work?
    Any help would be appreciated
     
  5. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    We deprecated 1.5.7+ nearly 2 years back and would request you to upgrade. This is because, lots has change regarding the stores requirements to make it compatible with current publishing.

    Please let us know if you have any issues upgrading.

    Cheers,
    VB Team
     
  6. GustavNinja

    GustavNinja

    Joined:
    Jun 13, 2016
    Posts:
    96
    Thanks for the reply. I will think about upgrading the plugin. For now I managed to get it to work by changing the names for the plugin folders and some code and minsdk error in Manifest file that needs to be moved to gradle file.
     
    Voxel-Busters likes this.
  7. zhangkun907

    zhangkun907

    Joined:
    May 17, 2022
    Posts:
    6
    Thanks for the reply.

    The AppleAuth plugin is used in the project, and when Essential Kit is enabled, a .entitlements file is also created. As a result, I need to manually add Sign in With Apple (capabilites) every time I export the ios project. How should I deal with it?
     
  8. zhangkun907

    zhangkun907

    Joined:
    May 17, 2022
    Posts:
    6
    I solved this problem by modifying PBXNativePluginsExporter.cs (line 169/171), and changing ios.entitlements to Entitlements.entitlements, but it would be better if the file name can be adjusted by modifying the plugin configuration.
     
  9. zhangkun907

    zhangkun907

    Joined:
    May 17, 2022
    Posts:
    6
    upload_2022-8-22_16-15-10.png
     
  10. YUTA-LEQUIOS

    YUTA-LEQUIOS

    Joined:
    Apr 8, 2016
    Posts:
    11
    I tried to share a StreamingAssets image, but it did not work with an error.
    I stopped the conversion to sbytes with NativeBytesWrapper and it worked fine.
    I would like to know if there are any problems with this approach.

    Unity : 2020.3.38f1
    Essetial Kit : v2.4.1
    Device : Android 12

    Code excerpts :
    LoadImage loads images from apk.
    Code (CSharp):
    1. var composer = ShareSheet.CreateInstance();
    2. composer.AddText(text);
    3.  
    4. StartCoroutine(LoadImage(imagePath, bytes =>
    5. {
    6.     if (bytes != default)
    7.     {
    8.         composer.AddImage(bytes, MimeType.kPNGImage);
    9.     }
    10.     composer.SetCompletionCallback((result, error) =>{});
    11.     composer.Show();
    12. }));
    NativeBytesWrapper.cs
    Corrected part :
    Code (CSharp):
    1.         public NativeBytesWrapper(byte[] array) : base(kClassName,
    2. // #if UNITY_2019_1_OR_NEWER
    3. //             array.ToSBytes()
    4. // #else
    5. //             array
    6. // #endif
    7.             array
    8.             )
     
    Last edited: Aug 24, 2022
  11. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    It's required to convert to sbytes as java accepts only signed values as java doesn't have a data type for unsigned values.
    May I know what actually happened when using sbytes conversion? Do you see any error?
     
  12. YUTA-LEQUIOS

    YUTA-LEQUIOS

    Joined:
    Apr 8, 2016
    Posts:
    11
    I cannot reproduce this error in Mono and it seems to be an IL2CPP only error. I will send you the details.

    Build Information:
    Gradle file properties : Gradle Version : 4.0.1
    Compile Sdk Version : 32
    Target Sdk Version : 32
    BuildToolsVersion : 30.0.3

    Editor Information:
    Unity 2020.3.38f1
    Essential Kit : v2.4.1

    Unity Settings:
    Minimum API Level : 21
    Scripting Backend : IL2CPP
    Api Compatibillity Level : .NET Standard 2.0
    Managed Stripping Level : Medium

    Devices on which the error could be reproduced:
    Galaxy S8 (Android 8)
    Galaxy S10 (Android 11)
    Google Pixel 3a (Android 12)

    Stack trace:
    Exception: ArgumentException: Object must be an array of primitives.
    System.Buffer.ByteLength (System.Array array) (at <00000000000000000000000000000000>:0)
    System.Buffer.BlockCopy (System.Array src, System.Int32 srcOffset, System.Array dst, System.Int32 dstOffset, System.Int32 count) (at <00000000000000000000000000000000>:0)
    VoxelBusters.CoreLibrary.NativePlugins.Android.Utility.ToSBytes (System.Byte[] from) (at <00000000000000000000000000000000>:0)
    VoxelBusters.EssentialKit.Common.Android.NativeBytesWrapper..ctor (System.Byte[] array) (at <00000000000000000000000000000000>:0)
    VoxelBusters.EssentialKit.SharingServicesCore.Android.ShareSheet.AddAttachmentData (System.Byte[] data, System.String mimeType, System.String fileName) (at <00000000000000000000000000000000>:0)
    VoxelBusters.EssentialKit.SharingServicesCore.Android.ShareSheet.AddImage (System.Byte[] imageData, System.String mimeType) (at <00000000000000000000000000000000>:0)
    VoxelBusters.EssentialKit.ShareSheet.AddImage (System.Byte[] imageData, System.String mimeType) (at <00000000000000000000000000000000>:0)
    ShareTest+<>c__DisplayClass3_0.<ClickButton>b__0 (System.Byte[] bytes) (at <00000000000000000000000000000000>:0)
    System.Action`1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0)
    ShareTest+<LoadImageBytes>d__4.MoveNext () (at <00000000000000000000000000000000>:0)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0)
    <>c__DisplayClass3_0:<ClickButton>b__0(Byte[])
    System.Action`1:Invoke(T)
    <LoadImageBytes>d__4:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)


    Test Code:
    Code (CSharp):
    1. using System;
    2. using System.Collections;
    3. using System.IO;
    4. using UnityEngine;
    5. using UnityEngine.Networking;
    6. using UnityEngine.UI;
    7. using VoxelBusters.CoreLibrary;
    8. using VoxelBusters.EssentialKit;
    9.  
    10. public sealed class ShareTest : MonoBehaviour
    11. {
    12.     [SerializeField] Button button;
    13.     [SerializeField] Text log;
    14.  
    15.     void Start() => button.onClick.AddListener(ClickButton);
    16.  
    17.     void ClickButton()
    18.     {
    19.         button.interactable = false;
    20.  
    21.         var imagePath = Path.Combine(Application.streamingAssetsPath, "share.png");
    22.         var composer = ShareSheet.CreateInstance();
    23.         composer.AddText("test");
    24.  
    25.         StartCoroutine(LoadImageBytes(imagePath, bytes =>
    26.         {
    27.             if (bytes != default)
    28.             {
    29.                 composer.AddImage(bytes, MimeType.kPNGImage);
    30.             }
    31.             composer.SetCompletionCallback((result, error) =>
    32.             {
    33.                 button.interactable = true;
    34.                 log.text = $"ResultCode:{result.ResultCode} error.Description:{error?.Description}";
    35.             });
    36.             composer.Show();
    37.         }));
    38.     }
    39.  
    40.     IEnumerator LoadImageBytes(string path, Action<byte[]> completedAction)
    41.     {
    42.         if (string.IsNullOrEmpty(path))
    43.         {
    44.             completedAction?.Invoke(default);
    45.             yield break;
    46.         }
    47.  
    48.         var isUri = Uri.IsWellFormedUriString(path, UriKind.Absolute);
    49.         byte[] data;
    50.  
    51.         if (isUri)
    52.         {
    53.             using var request = UnityWebRequest.Get(path);
    54.             yield return request.SendWebRequest();
    55.             if (request.result == UnityWebRequest.Result.Success)
    56.             {
    57.                 data = request.downloadHandler.data;
    58.             }
    59.             else
    60.             {
    61.                 completedAction?.Invoke(default);
    62.                 yield break;
    63.             }
    64.         }
    65.         else
    66.         {
    67.             try
    68.             {
    69.                 data = File.ReadAllBytes(path);
    70.             }
    71.             catch
    72.             {
    73.                 completedAction?.Invoke(default);
    74.                 yield break;
    75.             }
    76.         }
    77.    
    78.         completedAction?.Invoke(data);
    79.     }
    80. }
     
    Last edited: Aug 26, 2022
  13. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,935
    This looks like a bug in IL2CPP. We've recently fixed what seems to be a related one, but this one might be different. Can you submit a bug report about this issue? https://unity3d.com/unity/qa/bug-reporting
     
    Voxel-Busters likes this.
  14. YUTA-LEQUIOS

    YUTA-LEQUIOS

    Joined:
    Apr 8, 2016
    Posts:
    11
    A bug report has been filed (IN-14814). I checked and it seems that Buffer.BlockCopy is doing something bad.

    Test Code:
    Code (CSharp):
    1. using System;
    2. using UnityEngine;
    3. using UnityEngine.UI;
    4.  
    5. public sealed class Test : MonoBehaviour
    6. {
    7.     [SerializeField] Text text;
    8.  
    9.     void Start()
    10.     {
    11.         try
    12.         {
    13.             var bytes = new byte[] { 0xff };
    14.             // No error occurs
    15.             // var sbytes = Array.ConvertAll(bytes, b => unchecked((sbyte)b));
    16.             // error occurrence
    17.             var length = bytes.Length;
    18.             var sbytes = new sbyte[length];
    19.             Buffer.BlockCopy(bytes, 0, sbytes, 0, length);
    20.             Print("Conversion to sbyte succeeded", false);
    21.         }
    22.         catch (Exception e)
    23.         {
    24.             Print($"{e.GetType()}: {e.Message}\n{e.StackTrace}", true);
    25.             throw;
    26.         }
    27.     }
    28.  
    29.     void Print(string texts, bool isError)
    30.     {
    31.         text.text = texts;
    32.         if (isError)
    33.         {
    34.             text.color = Color.red;
    35.         }
    36.         else
    37.         {
    38.             Debug.Log(texts);
    39.         }
    40.     }
    41. }
     
    Last edited: Aug 26, 2022
  15. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,935
    This looks very interesting. Based on what I've seen from some internal discussions we are having now, the issue is triggered by that sbytes array. It looks like IL2CPP is not handling that properly.
     
    YUTA-LEQUIOS likes this.
  16. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Thanks for jumping in. We actually have this conversion in our plugin from past 2 years and we support from 2018 and up. Never faced this issue earlier on both mono and Il2cpp before. Any of your inputs are helpful.


    @YUTA-LEQUIOS Thanks for the script and required details. We will schedule a test and update soon.
     
    YUTA-LEQUIOS likes this.
  17. YUTA-LEQUIOS

    YUTA-LEQUIOS

    Joined:
    Apr 8, 2016
    Posts:
    11
    @Voxel-Busters
    Could you please add the code to read from the Android Apk? It would eliminate several steps for the developer. I am sure you can write even better code. Please consider this.

    It should probably go without saying, but the following code is intentionally written to avoid some errors.
    Code (CSharp):
    1. IEnumerator LoadImageBytes(string path, Action<byte[]> completedAction)
    2. {
    3.     if (string.IsNullOrEmpty(path))
    4.     {
    5.         completedAction?.Invoke(default);
    6.         yield break;
    7.     }
    8.    
    9.     byte[] data = default;
    10.  
    11.     if (Uri.IsWellFormedUriString(path, UriKind.Absolute))
    12.     {
    13.         using var request = UnityWebRequest.Get(path);
    14.         yield return request.SendWebRequest();
    15.  
    16.         if (request.result == UnityWebRequest.Result.Success)
    17.         {
    18.             data = request.downloadHandler.data;
    19.         }
    20.     }
    21.     else
    22.     {
    23.         try
    24.         {
    25.             data = File.ReadAllBytes(path);
    26.         }
    27.         catch {}
    28.     }
    29.  
    30.     completedAction?.Invoke(data);
    31. }
     
    Last edited: Aug 26, 2022
    Voxel-Busters likes this.
  18. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,935
    We recently corrected a different issue related to Buffer.BlockCopy in IL2CPP - it was not making the proper type checks. However that fix seems to have exposed this issue, which is a separate bug in our type checking code that doe snot handle the sbyte type properly.
     
    YUTA-LEQUIOS likes this.
  19. YUTA-LEQUIOS

    YUTA-LEQUIOS

    Joined:
    Apr 8, 2016
    Posts:
    11
    Voxel-Busters likes this.
  20. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,935
    To follow up here - we ended up with two bug reports about this issue (which is great, thanks all!). I've closed the one mentioned in this thread as a duplicate: https://issuetracker.unity3d.com/issues/buffer-dot-blockcopy-causes-error-when-using-il2cpp

    I'm waiting for the public link for the other bug to appear - I'll update this thread when I have it. The good news is that I'll be merging the fix today, so it should be on the way to a release soon.
     
  21. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,935
    Hey, unfortunately we are having an issue with our internal bug tracking system, so I cannot get an issue tracker link to work with this bug report. The fix is complete on our end, and is now its way to Unity releases.
     
  22. D_Cergy

    D_Cergy

    Joined:
    Feb 18, 2015
    Posts:
    35
    Hi, does the plugin supports Pending Transaction in Google Play?
    Pending.JPG
    I received this warning and trying to fix it, but I can only find IsProductPurchased(IBillingProduct) and it seems does not support consumables or this kind of pending transaction.
     
  23. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Actually we do. Pending transactions are nothing different other than the status. If a product is in pending state, if you try to purchase, it won't let you do it. But once the status is updated, based on the type (consumable or non-consumable) we call consume api(if its consumable) or we acknowledge the purchase.

    Please let me know if you have any trouble testing this in our demo billing scene.

    Thanks,
    VB Team
     
    D_Cergy likes this.
  24. overbuiltsgames

    overbuiltsgames

    Joined:
    Aug 28, 2021
    Posts:
    3
    Is there a way to get iOS camera picture:
    - in full (selected) camera resolution
    - With auto exposure
    - and auto focus?

    And get it in the form of the UnityEngine.Texture2D (in device RAM), not as a file (JPG/PNG) saved to the gallery.
     
  25. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    We don't offer a native camera texture, instead we take a picture as jpeg and then pass it to unity for making a texture.
     
  26. bcharan

    bcharan

    Joined:
    May 9, 2015
    Posts:
    4
    Hi there. Does the Billing Library support IAP with Google Play Billing Library v4?
    We're currently on 2018.4 and looking to avoid having to jump to 2020 just yet, as unity iap requires 2020.3.

    Thanks!
     
  27. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Yes, Its already 4+. We are planning to upgrade to 5+ post the current release.
    If you face any issues, do let us know. It should work on 2018.4+

    But,
    I suppose from last few releases unity stopped accepting < 2019 builds on asset store. So, you may need to first download the plugin in 2019.4 empty project, export it and import in your project. However, this is the case when the latest build you downloaded doesn't have V4+ billing client version. Most likely it should exist as it was done long back.
     
  28. bcharan

    bcharan

    Joined:
    May 9, 2015
    Posts:
    4
    Ok, thank you!

    So just to confirm, does your billing completely replace the unity IAP plugin functionality?
     
  29. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    We don't use unity's IAP. We have our own custom implementation. That's one of the reasons why we don't have any analytics dependency!
     
  30. bcharan

    bcharan

    Joined:
    May 9, 2015
    Posts:
    4
    Thanks,

    I meant to say, could we replace Unity IAP with your Billing plugin?
     
  31. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Oh got it!
    We currently support Consumable and Non-Consumable products alone. If you need subscriptions, it's in our current roadmap.
     
  32. D_Cergy

    D_Cergy

    Joined:
    Feb 18, 2015
    Posts:
    35
    Hello again, this time I am trying to replace my old implementation Google Cloud Saved Games with this plugin.
    Based on the tutorial and documentation, it seems that there is no method to call and show the Native Google Saved Games UI. It is something like the image below.

    AndroidCloud.JPG

    In my old implementation, I serialize and package all of user data into a byte array then upload or download it to restore user progress.
    Is there any way I can show this UI?
    Or maybe fetch the data (a single byte array variable) in the background so I can process and convert them to implementation of this plugin.
    Thanks!
     
  33. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Hi,
    We don't provide the UI for slot selection as there is no equivalent api on iOS. Also, you can have your own slot system with the API we provided. You have options to set byte array or string which you can use to assign profile data to each slot. For ex: Serialize your data and use SetString or SetByteArray method to achieve the same functionality.

    Thanks,
    VB Team
     
  34. D_Cergy

    D_Cergy

    Joined:
    Feb 18, 2015
    Posts:
    35
    I see.. actually the goal I want to achieve is transferring the data that some users might already have, made from Google Saved Games default UI previously. So it can be migrated to this plugin implementation.

    This plugin must have a function where it receive the binary data from Google server and then parse it with its own method (is it the IDictionary array from INativeCloudServicesInterface.cs?). Is there any way I can read that raw binary data (not the meta data) received from Google server, so I can parse it with my previous method?

    Anyway, it would be nice to have the default Saved Games UI accessible in the future updates, as it is the suggested way from official website and might be widely used by developers.

    Another important question. I assume this plugin using it's own serialization to package the data and upload it to server in the snapshot format described in Google documentation. If this plugin development is to be abandoned (I hope not), can I fetch it in other way and parse it so it is readable and could be converted to a newer system?

    Thanks!
     
  35. CWatsonT2

    CWatsonT2

    Joined:
    Jan 9, 2019
    Posts:
    114
    I was told your plugin might help me. I'm stuck in Unity 2019.4.28 due to plugin requirements. That means I can only go as high as IAP 4.1.5 which isn't high enough to be able to upload my game on Google Play. Will your app allow me to do in app purchases and not get the following error when I try to upload it to go Google Play?

    We've detected this app uses an unsupported version of Play billing. Please upgrade to Billing Library version 4 or newer to publish this app.

    Also if I tried it and still got that error could I get a refund? A $100 plugin is a lot for me right now.

    Warmest regards,
    Chris
     
  36. D_Cergy

    D_Cergy

    Joined:
    Feb 18, 2015
    Posts:
    35
    I am able to publish my game with this plugin and the IAP works fine, I think it use Billing Library version 4.0 which is the accepted minimum based that error message.
    You could check your older dependencies which might overwrites this plugin dependencies declaration.
    Make sure there is this library in Assets/Plugins/Android/com.android.billingclient.billing-4.0.0.aar after resolving the dependencies.
     
  37. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    We actually expected users will be using our cloud service from start of the game(v1). However, we see more requests regarding the migration from other plugins so we have a plan on how to solve this.
    1. Each plugin have a snapshot key for storing.
    2. We provide an option to enter the key in our settings so that we can migrate data from that snapshot if it exists and delete it

    I understand that snapshot UI is a good to have feature but unfortunately, its not available on iOS. For this reason we made a more generic abstraction. However, we will see if we can provide an utility if its highly anticipated feature. You can share your thoughts at https://feedback.essentialkit.voxelbusters.com

    I love to answer this as we have a proper answer for this :)
    Yes, we do use our own default serialization but you can set your own too :)
    Please set ExternalServiceProvider.JsonServiceProvider to your own serialiser. Hope that answers your question!
     
  38. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Currently, google accepts billing client which is above v4. We already have it in place and soon we upgrade to 5+ too post our current release.
     
  39. D_Cergy

    D_Cergy

    Joined:
    Feb 18, 2015
    Posts:
    35
    Thank you for the answer. Good to know it considering the flexibility with custom serialiser :)
    I will post a feature request for default Google Saved Games UI.

    As for now, I'm wondering, if there is a way to retrieve the data passed from Google Cloud server from this plugin code.
    Based on the official docs, The Google Saved Games snapshot data structure is the following :
    byte[] data, Bitmap coverImage, String description

    This plugin must have package all the variables data into that byte[] format, passing and receiving it from the server. Does this byte[] variable received from server exposed publicly within your code? So I can make modification to read that data for migrating.


    I've made a handling for the interrupted purchase delivery process by relaunching the game and it was working fine with the test card payment method.

    Recently, I got 2 reports that the failed transaction (ITEM_ALREADY_OWNED for consumables) do not clear up after the item delivered, which means already go through the Success Status. These 2 cases use Redeem Code as payment method. Is this a bug with Google Billing Library or the plugin implementation? Is there any way I could clear up the transaction status?
     
    Last edited: Oct 5, 2022
  40. CWatsonT2

    CWatsonT2

    Joined:
    Jan 9, 2019
    Posts:
    114
    I'm using 4.1.5 which won't let me upload it to Google Play. I was told on another thread that it's actually 4.4 or higher that I need to be allowed to upload it. But I can't install 4.4 with unity 2019. I tried it and got a bunch of errors. I asked Unity about it and their response was the only thing I can do to get IAP to work is to update to a newer version of Unity which unfortunately isn't an option for me. Would your plugin help me with this? It was suggested on another thread that it would.
     
    Last edited: Oct 9, 2022
  41. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Yes, our plugin works with 2018.4+
    We currently have 4+ version billing client and soon gets update for v5.
     
  42. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    No. It's not exposed. But we are making migration option available for devs coming from other plugins(Google play services github unity plugin) so that they can continue with our plugin. We soon (1-2 weeks) will have an update on this once we are done with current release.

    Thanks,
    VB Team
     
    D_Cergy likes this.
  43. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    We don't actually have a dependency with gradle version. Please share us the complete log to have a look. I think you are already discussing the same on our discord. So lets continue over there.
     
  44. zhangkun907

    zhangkun907

    Joined:
    May 17, 2022
    Posts:
    6
    When i save image to gallery in Android, got this error:

    10-24 15:15:05.750 15389 15456 E Unity : ArgumentException: Object must be an array of primitives.
    10-24 15:15:05.750 15389 15456 E Unity : at System.Buffer.ByteLength (System.Array array) [0x00000] in <00000000000000000000000000000000>:0
    10-24 15:15:05.750 15389 15456 E Unity : at System.Buffer.BlockCopy (System.Array src, System.Int32 srcOffset, System.Array dst, System.Int32 dstOffset, System.Int32 count) [0x00000] in <00000000000000000000000000000000>:0
    10-24 15:15:05.750 15389 15456 E Unity : at VoxelBusters.CoreLibrary.NativePlugins.Android.Utility.ToSBytes (System.Byte[] from) [0x00000] in <00000000000000000000000000000000>:0
    10-24 15:15:05.750 15389 15456 E Unity : at VoxelBusters.EssentialKit.Common.Android.NativeBytesWrapper..ctor (System.Byte[] array) [0x00000] in <00000000000000000000000000000000>:0
    10-24 15:15:05.750 15389 15456 E Unity : at VoxelBusters.EssentialKit.MediaServicesCore.Android.MediaServicesInterface.SaveImageToGallery (System.String albumName, UnityEngine.Texture2D image, VoxelBusters.EssentialKit.MediaServicesCore.SaveImageToGalleryInternalCallback callback) [0x00000] in <00000000000000000000000000000000>:0
    10-24 15:15:05.750 15389 15456 E Unity : at VoxelBusters.EssentialKit.MediaServices.SaveImageToGallery (System.String albumName, UnityEngi
     
  45. zhangkun907

    zhangkun907

    Joined:
    May 17, 2022
    Posts:
    6
    Code (CSharp):
    1. namespace VoxelBusters.CoreLibrary.NativePlugins.Android
    2. {
    3.     public static class Utility
    4.     {
    5.         public static sbyte[] ToSBytes(this byte[] from)
    6.         {
    7.             if (from == null)
    8.                 return null;
    9.  
    10.             // int length = from.Length;
    11.             // sbyte[] to = new sbyte[length];
    12.             // Buffer.BlockCopy(from, 0, to, 0, length);
    13.             // return to;
    14.             return Array.ConvertAll(from, b => unchecked((sbyte)b));
    15.         }
    16.     }
    17. }

    I fix it with this code.
     
  46. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    2.5.0 has the required fix.
     
  47. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Hello,

    Wondering if you can please help me. I am trying to send an email with a csv attachment however when I check the attached file rather than what is supposed to be in it it shows this: /storage/emulated/0/Android/data/com.myBizz.myApp/files/SiteReading.csv

    This is the script (I have a feeling its got something to do with the "byte[]" attachment data, maybe I am doing it wrong.)



    Code (CSharp):
    1.         string attachment = Application.persistentDataPath + "/SiteReading.csv";
    2.         byte[] mybytes = Encoding.ASCII.GetBytes(attachment);
    3.      
    4.         string SiteName = _es.Get_Selected_Site_Name();
    5.  
    6.         string mail_Message = "Hello, \n \n";
    7.  
    8.         MailComposer composer = MailComposer.CreateInstance();
    9.         composer.SetToRecipients(new string[1] { "email@email.COM" });
    10.         composer.SetCcRecipients(new string[1] { "mymail@emai.lcom" });
    11.         // composer.SetBccRecipients(new string[1] { "bcc@gmail.com" });
    12.  
    13.         composer.SetSubject(_brain.Current_Date + " Bin Levels " + SiteName);
    14.         composer.SetBody(mail_Message, false);//Pass true if string is html content
    15.         composer.AddAttachment(mybytes, "text/csv", "SiteReading.csv");//fileByteData => file data bytes
    16.         composer.SetCompletionCallback((result, error) => {
    17.             Debug.Log("Mail composer was closed. Result code: " + result.ResultCode);
    18.         });
    19.         composer.Show();
    Much appreciated


    Edit: NVM
    byte[] attachmentBytes = File.ReadAllBytes(attachment);

    Works =)
     
    Last edited: Oct 25, 2022
    Voxel-Busters likes this.
  48. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Hello again,

    Seems I've run into a bug?

    Upon testing the app I have it check the version and if the app has an update i do ->

    Code (CSharp):
    1.         AlertDialog dialog = AlertDialog.CreateInstance();
    2.         dialog.Title = "New Version Available!";
    3.         dialog.Message = "A new version of the app is available! Do you want to update to the latest version?";
    4.         dialog.AddButton("Yes", () =>
    5.         {
    6.             Debug.Log("Yes button clicked - Open App Store");
    7.             OpenAppStore();
    8.         });
    9.         dialog.AddCancelButton("No", () =>
    10.         {
    11.             Debug.Log("No button clicked - App will not update");
    12.         });
    13.         dialog.Show(); //Show the dialog
    and if they press ok ->
    Utilities.OpenAppStorePage(applicationId);

    I selected OK and then backed to get back into the app.

    Upon going back to the app that the automatic "Support by rating app" popup came as I have it turned on in the settings, with the 3 options: Remind me later, Cancel, OK

    However, none of the buttons are working (I am assuming due to the previous popup)

    Note: Not even pressing my phone's back button clears this popup for rating
     
  49. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Upon further investigation

    Firstly the Support App rating window pops up then the dialog for my update

    When i open the appstore and go back into the app, I have these logcat details:

    Window{fb211d2 u0 com.myapp/com.google.firebase.MessagingUnityPlayerActivity}: Setting back callback null

    Input channel object 'fb211d2 com.myapp/com.google.firebase.MessagingUnityPlayerActivity (client)' was disposed without first being removed with the input manager!

    [1491] kfk.run(23): Dropped referrer for com.myapp because dropped_already_installed

    Then i go back into the app, but cannot get rid of the rating pop up due to having been in the appstore via the other dialog option

    Here are my attempts to go to home screen, back into the app, and then trying to 'go back' to cancel the popup to no avail:

    Channel [Gesture Monitor] swipe-up (server) is stealing touch from [7dd7c04 com.myapp/com.google.firebase.MessagingUnityPlayerActivity (server), [Gesture Monitor] Quick Tap (server), [Gesture Monitor] edge-swipe (server)]

    startBackNavigation currentTask=Task{ce6382e #2512 type=standard A=10374:com.myapp U=0 visible=true visibleRequested=true mode=fullscreen translucent=false sz=1}, topRunningActivity=ActivityRecord{91b2f83 u0 com.myapp/com.google.firebase.MessagingUnityPlayerActivity} t2512}, callbackInfo=OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@cb85470, mPriority=0}, currentFocus=Window{7dd7c04 u0 com.myapp/com.google.firebase.MessagingUnityPlayerActivity}

    and these with multiple tries

    Channel [Gesture Monitor] edge-swipe (server) is stealing touch from [7dd7c04 com.myapp/com.google.firebase.MessagingUnityPlayerActivity (server), [Gesture Monitor] Quick Tap (server), [Gesture Monitor] swipe-up (server)]

    startBackNavigation currentTask=Task{ce6382e #2512 type=....


    NOTE: If I press NO on the dialog pop up, i can select remind me later, OK, or cancel on the rating pop up

    Also, if i don't have the app update dialog, only the rating, going outside of the app and back in you cannot discard accept or remind later the Rating pop up either. Basically it happens when you leave the app and get back into it

    Here is the logcat:

    Window{6e2ba45 u0 com.myapp/com.google.firebase.MessagingUnityPlayerActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@979b5c1, mPriority=0}
    Channel [Gesture Monitor] swipe-up (server) is stealing touch from [6e2ba45 com.myapp/com.google.firebase.MessagingUnityPlayerActivity (server), [Gesture Monitor] Quick Tap (server), [Gesture Monitor] edge-swipe (server)]
     
  50. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Are you using rating feature or just open app store feature from utilities? Do you mean it showed rating dialog even though you haven't called it?

    Also, could you please share what plugin version are you using? Thanks for the details btw, I'm on it!