MobileKit for iOS & Android

12 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 plugin 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.MobileKitActivity. MobileKit won’t override your manifest file if you already have one but don’t forget to change your main Activity.

 


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

12 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 😉

  • fer - June 1, 2017 reply

    Hi, i’m looking a plugin that it can record a video with the camera, your plugin can record a videos?

    Q

    Q - July 7, 2017 reply

    Nope sorry.

  • Fai - July 3, 2017 reply

    Hi,
    Is there any way to open front camera by default. Currently it pickup the camera which is set by device native camera app.

    Q

    Q - July 7, 2017 reply

    You’re right. At this moment it’s not possible but I’ll add a feature to do that.
    I hope I can do it soon.

  • Spencer - September 12, 2017 reply

    Hi,
    I’m having an issue with capturing a photo on Android. As soon as I take a picture the app fails. I noticed the app asked permission to access the phones files, but did not ask permission for the camera. I went through the setup process twice and everything else is working properly. Any idea what I’m missing?
    Thanks!

    Q

    Q - September 12, 2017 reply

    I replied to you by email.
    Please give me more details like Android Version, Phone Version, Android error logs.
    Thank you.

Leave a Reply

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