choose profile pic in unity3d for android/ios - unity3d

i have my profile page displaying user information.
This page has user's image and i want to allow user to choose his pic.
So is there any way to open dialog box to choose pic from android/iOS device in unity3d ?

I would recommend the various Prime31 plugins for accessing the CameraRoll and photographs storage. There are many other assets available on the Asset Store that also provide the same functionality. It is not possible to do this directly through Unity without some programming effort.

Related

branch.io sharesheet questions

Im using branch.io's sdk for unity, im having 2 questions im hoping someone could answer:
1: Is it any way to restrict the share sheet from sharing to certain apps? for example some apps that doesn't handle links well and in special the sms service.
The reason we do not want the ability to send by sms is that the app needs permission to access the phone book and thus the google play service will need an "privacy policy" link.
2: If its not then i would like to know if you guys could lead me in the right direction when writing a privacy policy because i do not have any legal education and do not know how to wright it. Is it sufficient to state that we are using your sdk? The demands are things like "you should see to it that the code is secure and encrypted" (Something like that) though i'm using your sdk and do not have a clue about how it works.
Thanks!
There is no way to change the list of apps from the share sheet in Branch's Unity SDK. Although Branch does have an end point to exclude certain apps using the Android SDK.
You will need to export your Unity 3D project to Android Studio. Once you successfully export the project, you can use the Branch Android SDK endpoint to exclude any app by providing the Package name of the App.
This is the sample code to update your Share Sheet:
//define the share sheet style
ShareSheetStyle shareSheetStyle = new ShareSheetStyle(context, shareTitle, shareDescription)
.setCopyUrlStyle(getResources().getDrawable(android.R.drawable.ic_menu_send), "Copy this URl", "Link added to clipboard")
.setMoreOptionStyle(getResources().getDrawable(android.R.drawable.ic_menu_search), "Show more")
.addPreferredSharingOption(SharingHelper.SHARE_WITH.FACEBOOK)
.addPreferredSharingOption(SharingHelper.SHARE_WITH.GMAIL)
.addPreferredSharingOption(SharingHelper.SHARE_WITH.TWITTER)
.addPreferredSharingOption(SharingHelper.SHARE_WITH.PINTEREST)
.setAsFullWidthStyle(true)
.setSharingTitle("Share With");
//to exclude whatsapp from the Share Sheet
shareSheetStyle.excludeFromShareSheet("com.whatsapp");
//to exclude android messages app from the Share Sheet
shareSheetStyle.excludeFromShareSheet("com.google.android.apps.messaging");

Icon iphone apps

Is it possible to programmatically get access to the icon of other apps installed on an iPhone?
For example: if I need Instagram's icon, is it possible to display it in my app by accessing the icon in the Instagram bundle?
You're not allowed to access anything in other app bundles, but you can find the icons on the web if you know the URL. The icon images are in the app store page, which can be reached by (for example) here. The URL is subject to change, so saving a copy to your own app bundle would be the best way to ensure access to them.
http://a3.mzstatic.com/us/r1000/060/Purple/v4/76/94/e2/7694e29c-3060-9f8e-0135-cbeea67ec3af/mzl.qmyfwfsq.175x175-75.jpg
No you have to find the icon if you want to use it.
Nevertheless, you have an instagram-sdk for iOs. Maybe you should look at this.
You'll need to get the icon somewhere else. If it's specifically Instagram you can get it from their SDK, but for the mostpart, you'll need to find it on your own.
As far as I know you'll have to keep a set of icons in your own app, which you can show to the user at a certain point. But I'm sure you cannot access the icon of an app installed on the phone like that!

Phonegap: display list of photos in camera roll?

I want to create a multi photo upload for my phonegap app -- currently this is not available so I'm wondering if it would be possible to create an HTML version of the camera roll.
My thought would be if I could get access to the list of photo URI's from the camera roll, I'd display them in my own HTML version of the camera roll, allow multiple photos to be selected, and then upload the ones that are selected - bypassing the native camera roll.
Is this possible?
Thanks!
This is not possible because iOS apps are sandboxed:
For security reasons, iOS places each app (including its preferences and data) in a sandbox at install time. A sandbox is a set of fine-grained controls that limit the app’s access to files, preferences, network resources, hardware, and so on. As part of the sandboxing process, the system installs each app in its own sandbox directory, which acts as the home for the app and its data.
(Source: Apple's iOS App Programming Guide)
This means that an app can only access its own files directly. So the photo roll is the only way for you to access the photos stored on the device.

Is it possible for a web based app to retrive images from an iphone?

I'm creating a website which I would like to be supported on the iphone as well. The site allows users to upload images and manipulate them. On a desktop the user will simply click the upload button to select the file from their computer and upload it to the site. But this will fail on an iphone.
Is there any way for a pure web app which is using php/mysql/js and runs inside the browser to get images from a user's camera roll? Does Apple offer any APIs to make this possible?
No, it's not possible currently - but apparently iOS 6 is going to support image and video uploads from MobileSafari.
(Apart from that, you can ask your users if their device is jailbroken and id so, suggest them downloading Safari Upload Enabler from Cydia).

iPhone: Access Camera and Album from Web app

I want to develop a web app using html5, js. One of the feature is to launch device Camera and record video, take a picture and access photo album. Is it possible to access via web app if i develop? I saw in the forums that, it is saying not possible in some places and it is possible in some places. I would like to know, is it really possible to access directly camera and album etc. ?
Please suggest!
Thank you!
It's not possible to access phone camera using Web app, as the "Web APP" typically runs in the browser of device.
Though there are some frameworks (like Phonegap) allows you to embedd your web app into native container. With this approach and added libraries from such framework you can access some of those native API's and Device Hardware.
One Possible solution is,
Create one app and distribute it using app store
using your webapp, you can connect to above app using url-scheme
http://code.google.com/p/iphone-photo-picker/
go to above link, where you can find complete code for it.