MobileKit for iOS & Android

6 comments

Taking a picture from your camera to apply on a Material or sharing your best score with a screenshot of your game are certainly common features many developers want to handle quickly and easily.
MobileKit offers a clean and easy way to open native camera roll, image gallery and share features on iOS & Android devices.

AVAILABLE ON UNITY ASSET STORE

The native camera & gallery feature returns a bitmap file path back to Unity and the share functionality can send a message with a texture and opens a native dialog to choose the desired app according the platform.


HOW TO START

First, set your project for mobile build, iOS or Android.

buildsettings


ANDROID

Don’t forget to generate your manifest file. Go to Main Menu > Tools > MobileKit > Generate Android Manifest.

header

If you have multiple plugins, take care about conflicts in your manifest file and be sure your main activity is org.cornflex.mobilekit.MainActivity. MobileKit won’t override your manifest file if you already have one but don’t forget to change your main Activity.

WARNING:
In order to run this plugin on Android 7.0 (API 24) devices, you must set Minimum API Level to Android 4.1 (API 16) and Target API Level to Android 6.0 (API 23) in your Player Settings (Unity 5.6).


iOS

The iOS library (MobileKit.a) is compiled for iOS 6.0 and above and is automatically packed when your XCode project is generated.

Sinde iOS 10, you must enter Usage Description for Camera and PhotoLibrary access.
You can do it partially under Player Settings or directly inside your info.plist under XCode.
Be sure these 2 entries are set in info.plist before compiling:

NSPhotoLibraryUsageDescription : “Your text”
NSCameraUsageDescription : “YourText”


DEMO SCENE

Open the demo scene, set your project for mobile build, Android or iOS, and press Build & Run.
Then take a look at MobileKitDemo.cs, it is quite easy to implement:

folder


SCREENSHOTS

 

QMobileKit for iOS & Android

6 comments

Join the conversation
  • Alexander - October 11, 2016 reply

    Hello, Quentin!
    I bought your plugin Mobile Kit for Unity(https://www.assetstore.unity3d.com/en/#!/content/63705). Could you please options in the library MobileKit.a for iOS for aspect or output when the photo is cut . Aspect 1:1 uncomfortably now. Thank’s.

    Q

    Q - October 11, 2016 reply

    Thanks Alex.
    I’ll try to add this feature as soon as possible (this weekend?) I’m fighting with 2 other projects right now :/

    Q.

    Alexander - October 13, 2016 reply

    Thanks!

  • Q

    Q - February 12, 2017 reply

    Current version is 1.0.5. Cropping is now optional.
    Use MobileKitImageFormat.Cropped or MobileKitImageFormat.Full as parameter.

    Please refer to this page and follow the example.

  • Emmanuel - May 18, 2017 reply

    Greetings, bought this plugin and it is fantastic.
    Is there a way, in iOS, to have the image picker dialog shown in landscape mode ? It seems to be locked to Portrait.
    Thanks !

    Q

    Q - May 19, 2017 reply

    Done, check your email 😉

Leave a Reply

Your email address will not be published. Required fields are marked *