Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Native Toolkit - Native functions for iOS, Android and WP8

Discussion in 'Assets and Asset Store' started by zoooom, Feb 25, 2015.

  1. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    50
    Edit: Unfortunately I no longer have time to support this Asset, so have moved the source onto Github:

    https://github.com/ryanw3bb/native-toolkit

    I hope it is still useful to someone :)

    -----------------------------------

    Native Toolkit
    is a lightweight plugin aimed at making it easy to integrate native device functionality into your Unity3D mobile project.

    A full Scripting Reference can be found here.

    Examples of what you can do on iOS, Android and Windows Phone 8 devices with just one line of code:
    • Pick an image from the gallery/camera roll
    • Use the camera to take a photo
    • Save a screenshot to the gallery/camera roll
    • Get device GPS location
    • Send an email with attachments
    • Schedule local notifications

    ... Any many more. Please see the scripting reference for the full list!

    Available now on the Asset Store >>> http://u3d.as/bEt

    If you have any support questions or requests, please either post in this thread or drop an email to contact@secondfury.com.
     
    Last edited: Jun 26, 2018
  2. Skatola

    Skatola

    Joined:
    Jan 17, 2013
    Posts:
    45
    hi, excellent plug-in, i was looking for something like that : ) just some info:
    - i read about an incompatibility with xiaomi4 in the user review on your asset store page, it is fixable?
    - i need also a function for the phonebook access on ios/android/wp8, your plug-in can do that too?
    thanks a lot : )
     
  3. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    50
    Hi there, access to phone contacts is a feature I've just added and will be in the next update (it'll probably get accepted onto to the Asset Store sometime next week).

    As for the Xiaomi 4, I think the issue was more that it was running a non standard ROM. I'll be honest I haven't heard back from that user, so it may have just been a temporary fault with their device.

    Edit: turns out it was likely a missing permission in AndroidManifest.xml
     
    Last edited: Mar 27, 2015
  4. Skatola

    Skatola

    Joined:
    Jan 17, 2013
    Posts:
    45
    awesome! thank you for your reply, when the new feature will be up in the store i'll buy your asset for sure, thanks for your work : )
     
  5. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    50
    Native Toolkit v1.1.1 is now on the Asset Store!

    This update allows you to pick a contact from your address book and return the contacts name, number and email address.

    There are also a couple of bug fixes for WP8.

    http://u3d.as/bEt
     
  6. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Is there a way you can provide a callback on iOS and Android each time the location is updated? So rather than us having to query the location (which might take some time to initialise) instead subscribe to an event and it inform us when the location is updated? I would more than likely purchase this asset if you could add this in.
     
  7. Mgaia-Studio

    Mgaia-Studio

    Joined:
    Jul 22, 2014
    Posts:
    11
    Hello!

    I've bought your plugin to support local notifications on Android and WP8 versions of my game. It's a great plugin and it's working very well.

    But i want to ask if you can add some funcionalities to it:
    • Is there a way to support expandable notifications? For now, if the notification message is large, there's no way to read it
    • Can you add support for playing audio effects when the notification arrives?
    • When i touch the notification, the app's activity restarts. Is there a way to open the app activity on its current state, without restarting it?
    Thanks!
     
  8. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    50
    @mimminito as soon as you use the GPS it is initialised and and stays that way, if the plugin provided a Callback all it would be doing it grabbing the location every x seconds and comparing it to the previous location behind the scenes.

    @Mgaia Studio, thank you for your suggestions, I can confirm the next version of Native Toolkit will have some upgrades to the Local Notification system, so watch this space! :)
     
  9. Mgaia-Studio

    Mgaia-Studio

    Joined:
    Jul 22, 2014
    Posts:
    11
    Oh that's great!
    Can you tell me when do you plan to release this new version?
     
  10. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    50
    All being good it'll probably be on the asset store towards the end of next week.
     
  11. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    50
    Native Toolkit v1.1.2 has now been released onto the Asset store!

    This update mainly contains upgrades to the local notification system, allowing you to specify custom sounds and vibration, as well as some cosmetic updates for Android notifications.

    There are also a few bug fixes in there, give me a shout if you need further details.

    http://u3d.as/bEt
     
    KeepTrying and SAOTA like this.
  12. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Hello zoooom,

    I can build Native Toolkit in WP8 but seems that facebook is not working, hit Login does not have any effect. Please help !

    Also when user have no contacts / no image we can not cancel, maybe you should implements those as well so when users change their mind they will have a way back.

    I also got several warning when importing NativeToolkit into Unity5, should be easy fixes I believe, maybe you can also have a look ...

    Thanks.
     
    Last edited: May 22, 2015
  13. chiphuc113

    chiphuc113

    Joined:
    May 3, 2015
    Posts:
    8
    Have any way for me to get the images avatar of user thought plugin?
     
  14. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    50
  15. fermmmm

    fermmmm

    Joined:
    Oct 18, 2013
    Posts:
    129
    NativeToolkit.PickImage is working fine on Android but on IOS is crashing the app with the following error in the Xcode console:
    2015-05-28 16:39:59.955 FunnyFactory[1020:60b] *** Terminating app due to uncaught exception 'NSGenericException', reason: '-[UIPopoverController dealloc] reached while popover is still visible.'
    *** First throw call stack:
    (0x2e542fd3 0x39027ccf 0x2e542f15 0x30fa8e95 0x39036b6b 0xfc80e8 0x1a5e5c 0x130418 0x83da0 0x17bf04 0x89528 0xe932e8 0x1a0afd4 0x1aad4ec 0x12676ac 0x126766c 0x125d348 0x115cc94 0x1211b2c 0xfdd8b4 0x41264 0x411b0 0x41034 0x3950f833 0x3950f81f 0x3951649f 0x2e50d8f1 0x2e50c1c5 0x2e476f0f 0x2e476cf3 0x33370663 0x30dc216d 0x31554 0x39534ab7)
    libc++abi.dylib: terminating with uncaught exception of type NSException

    Version I'm using: 1.1.3 (the current one)
    Devices I have to test and this happens:
    - Ipad 2 MC770LL/A with IOS 7.1.1
    - Ipad 3 MC705LL/A with IOS 7.1.0

    I Googled the error and I found this, maybe it can help you to see what is happening:
    http://stackoverflow.com/questions/...ealloc-reached-while-popover-is-still-visible

    Please fix this as soon as you can because this is delaying an app delivery and is very important in my company.
    Reply to me for anything you need.
     
  16. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    50
    Native Toolkit v1.1.4 has now been released onto the Asset store!

    http://u3d.as/bEt

    This update contains a new function WasLaunchedFromNotification(), that basically does what it says on the tin. There are also some minor fixes, and a slight change to the large icon setup for Android notifications.

    @fermmmm that bug is now fixed too
     
  17. amchacon

    amchacon

    Joined:
    Apr 7, 2015
    Posts:
    1
    Hi,

    i have a stored file in "Assets\Data\". It is a XML file. Can I send an e-mail with this file attached?
     
  18. bysreg

    bysreg

    Joined:
    Jul 28, 2013
    Posts:
    8
    hello,

    do you have a demo in google play or ios app store ?
     
  19. jjenningsfuel

    jjenningsfuel

    Joined:
    May 19, 2015
    Posts:
    2
    Hi Native toolkit devs, I am evaluating the mens for facebook integration for our next app and our two primary concerns are get user scores and getting friends scores. is there an easy way to do that using your plugin ? We have already figured out how to do it with other solutions but it is somewhat of a cumbersome process . Do you have any implementation of accessing friends or user scores from facebook or have it planned in the future ?
     
  20. Skatola

    Skatola

    Joined:
    Jan 17, 2013
    Posts:
    45
    Hi Ryan, i've a problem with alert popup and confirm popup, i sent u an email hope u can help : ) thank you
     
  21. IJsLauw

    IJsLauw

    Joined:
    May 31, 2015
    Posts:
    15
    Hi @zoooom

    We bought your plugin and implemented the local notifications for iOS and android, everything seems to be working for iOS, but for android it is giving us some problems... If I set a notification and minimize the app, and wait for the notification to open, the app crashes when I click the notification, it just stops... and then restarts.

    I tried debugging this in the logcat but I can't pinpoint the exact error ... it happens every time. Closing the app after setting a notification, waiting for it and then clicking the notification seems to work just fine btw.

    Hope you can help!

    Regards,
    Laurent
     
  22. illustir

    illustir

    Joined:
    Dec 12, 2014
    Posts:
    24
    Hi!

    The TakeCameraShot works nicely for us. One thing I was wondering about: could some minor customizations be included?

    For our current project it would be nice if there was no way to Cancel taking a picture. The fact that they can review and retake it is excellent but if they press cancel, we have to send them back into this flow. That's a bit awkward.

    I also have some questions about the layout of the camera view (on iPad the button is to the side?) but those aren't super urgent.

    Best,
    Alper
     
  23. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    50
    @illustir all of those UI features are part of the built in iOS Camera view, AFAIK there is no way to modify them.
     
  24. fahd

    fahd

    Joined:
    Aug 7, 2014
    Posts:
    31
    Hi
    thanks for the awesome plugin I want to know how to take a picture without cropping it cuz when i take the picture it ask me to chose part of the image to use it but i want to use the full image
     
    illustir likes this.
  25. fahd

    fahd

    Joined:
    Aug 7, 2014
    Posts:
    31
    @zoooom I really need an answer can u please provide me with the support !!
     
  26. TinkWooz

    TinkWooz

    Joined:
    Jun 20, 2014
    Posts:
    2
    Hi !
    I have problems to integrate the plugin on Android. I use it for local notifications. With iOS everything works fine. But on Android, each time I call a NativeToolkit method, I have this kind of error :

    java.lang.ClassNotFoundException : com.secondFury.nativetoolkit.Main
    UnityEngine.AndroidJNISafe.CheckException ()
    UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPtr clazz, intPtr methodeID, UnityEngine(value[] args)
    UnityEngine.AndroidJavaObject._CallStatic[AndroidJavaObject] (System.String methodName, System.Object[] args)
    UnityEngine.AndroidJavaObject.CallStatic[AndroidJavaObject] (System.String methodName, System.Object[] args)
    UnityEngine.AndroidJavaObject.FindClass (System.String.className)
    UnityEngine.AndroidJavaObject..ctor (System.String.className)
    NativeToolkit.get_Instance ()
    NativeToolkit.ScheduleLocalNotification ( System.String title, System.String message, Int32 id, Int32 delayInMinutes, System.String sound, Boolean vibrate, System.String smallIcon, System.String largeIcon)

    I check my manifest, it contains
    <activity android:name="com.secondfury.nativetoolkit.MainActivity"
    android:configChanges="orientation|screenSize" />
    <activity android:name="com.secondfury.nativetoolkit.LocalNotificationResult" />
    <receiver android:name="com.secondfury.nativetoolkit.LocalNotification"/>
    and the permissions required

    My project use Unity 4.6
    minSdkVersion = 14
    targetSdkVersion = 21

    Someone has an idea why ? Did I miss something ?
    Thanks for your help
     
  27. nm8shun

    nm8shun

    Joined:
    Jul 14, 2007
    Posts:
    476
    Is there anyway to resize a screenshot taken with NativeToolkit before attaching it in email (also via NativeToolkit)?
     
  28. IJsLauw

    IJsLauw

    Joined:
    May 31, 2015
    Posts:
    15
    Same problem here... no solution yet?
     
  29. illustir

    illustir

    Joined:
    Dec 12, 2014
    Posts:
    24
    Hello,

    Our iPad system and app are in Dutch which is reflected in the systemLanguage that Unity gets as well. For some reason the NativeToolkit Camera component (on iOS) still uses English language strings. This is confusing to the kids who use our game.

    Are the language settings/environment not passed through from Unity to native? Any way we could fix this?

    Thanks,
    Alper
     
  30. ParaLogic

    ParaLogic

    Joined:
    Aug 19, 2010
    Posts:
    177
    @fahd : You can disable the cropping part by opening Camera.mm (Plugins/iOS/Camera.mm). Then change:

    Code (custom):
    1. UIImage *img = [info objectForKey:UIImagePickerControllerEditedImage];
    to
    Code (custom):
    1. UIImage *img = [info objectForKey:UIImagePickerControllerOriginalImage];
    And:
    Code (custom):
    1. picker.allowsEditing = YES;
    to
    Code (custom):
    1. picker.allowsEditing = NO;

     
  31. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    470
    Hello,
    can not build with Unity 5.3.x for Windows Phone 8.1
    WP 8 doesn't exist anymore...
    Plz when do you update the plugin to work again for Windows Phone?
    many thx
    M.
     
  32. Skatola

    Skatola

    Joined:
    Jan 17, 2013
    Posts:
    45
    hi, a lot of my app users complain about crash during the takecamerashot() callback...
    Any of you have this behaviour? any suggestion? thank you
     
  33. SuperdevUnity

    SuperdevUnity

    Joined:
    Feb 16, 2015
    Posts:
    2
    Hi,
    I am using TakeCameraShot() and I have a crash during callback. Perhaps the use a bad method! The tests on a Android 5.1.1.

    Log :
     
  34. Sufyan-Elahi

    Sufyan-Elahi

    Joined:
    Jul 27, 2013
    Posts:
    7
    hi,
    i am using this plugin for android. My question is:
    why my application restart when select image from gallery?

    thanks for this plugin
     
  35. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    >NativeToolkit.PickImage<

    And it still exists. Ipad. IOS 10.0.1
     
  36. Skatola

    Skatola

    Joined:
    Jan 17, 2013
    Posts:
    45
    hi.... with ios 10 pickcontact() function doesn't work anymore on ios, i really love your plugin but seems like you don't support it anymore...
    Please update it asap if you're still there or we need to find something else..
     
  37. prawn-star

    prawn-star

    Joined:
    Nov 21, 2012
    Posts:
    63
    Hi
    It appears I can only send images as attachments with iOS (as it embeds it into the email)
    Is it possible to send other files such as txt,xml or xls?
    Android works great and can send these files

    Cheers
     
  38. UDN_9196e8d4-15b9-4711-9045-cac350bcf64c

    UDN_9196e8d4-15b9-4711-9045-cac350bcf64c

    Joined:
    Mar 29, 2017
    Posts:
    3
    can i add contact in my device from app.??????
     
  39. iPedro

    iPedro

    Joined:
    Dec 28, 2011
    Posts:
    14
    Does ShowAlert only allow 1 button? Meaning I cannot have Ok and Cancel options? If this is true then what is the point of the call back having a result boolean? Thanks.

    I'm looking through the history here now as well as the asset store page and it looks like no one is getting any answers to their questions and the asset itself hasn't been updated in almost a year. Doesn't look too promising, I'm not going to risk using this thing.
     
    Last edited: Dec 21, 2017
  40. keni4

    keni4

    Joined:
    Nov 30, 2014
    Posts:
    31
    Hi, @zoooom
    How I can clear badge from ios app icon when user clears the notification?
     
    Last edited: Jan 15, 2018
  41. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    50
  42. muckletone

    muckletone

    Joined:
    Jan 20, 2019
    Posts:
    4
    Hello @zoooom , thank you for sharing this code, as a beginner things like this are huge. And to be clear, i understand you are not able to provide support any longer. But i do have one guidance questions. Been trying to implement the "saveScreenshot" function in Vuforia AR proof of concept app. The function indeed does work, but for some reason, introduction of this code seems to disable the camera. so the screenshot is placed in the iOS Photos library, but its a black screen with the UI artifacts recorded.

    Do you think think the folks over at contact@secondfury.com will be able to guide me through how to enable the camera again? I am reaching out, but wasn't sure if they can offer any support like this.

    most appreciatively,
     
  43. pavelsvs2012

    pavelsvs2012

    Joined:
    Oct 6, 2020
    Posts:
    8


    hi, tell me when I use TakeCameraShot (); the application is criticizing. Although in the manifest all permissions are indicated and I first request them.

    Code below:

    b_TakePhoto.onClick.AddListener(() => {
    PermissionsController.HasPermission(Permission.Camera, granted => {
    if (granted)
    {
    PermissionsController.HasPermission(Permission.ExternalStorageWrite, _granted =>
    {
    if (_granted)
    NativeToolkit.TakeCameraShot();
    });
    }
    });

    });