Uploading Images to Facebook via Android SDK [GOTCHA]
Hi Coders!
I am not going to go in how to upload to Facebook as they change their API as often as I change my underwear. You are better off looking at their developer site.
That being said, one thing I found that they didn't really talk about was adding a content provider.
If you don't you will get various error messages when you try to present the dialog.
The 2 errors I received were:
FileNotFoundException: No content provider: content://com.facebook.app.NativeAppCallContentProvider......
and
SecurityException: Permission Denial: opening provider com.facebook.NativeAppCallContentProvider
The first gave me the clue I should add a content provide (more on this in a minute) and the second told me it wasn't allowed.
1. Add the content provider to your manifest.
<provider android:authorities="com.facebook.app.NativeAppCallContentProvider{facebook-app-id}" android:exported="true" android:name="com.facebook.NativeAppCallContentProvider"/>
2. Make sure exported = true (as above)
If you look at their examples in Github they don't set the export flag. But then they don't need to, as the packages are all off of com.facebook
Anyway with that solved I could move on.










