I have been playing around with sharing photos from my app to Instagram.
I have worked out how to do it with DocumentInteraction, with code of the form:
This results in a decidedly messy user interaction - you get a menu asking for the app to share with even if Instagram is the only candidate.
According to this hit:
http://blog.horizon.camera/post/102273431070/video-share-objc-ios-instagram
there are some undocumented URL schemes that allow you to directly share content.
I have experimented with URL schemes in a slightly different context and got it working but I cannot for the life of me work out how to use (as expressed in the above hit):
instagram://library?AssetPath=[URL ENCODED STRING OF PHOTO LIBRARY ASSET URL]
in B4i, so that I can share a jpg from DirAssets.
Any suggestions appreciated...
I have worked out how to do it with DocumentInteraction, with code of the form:
B4X:
Sub Process_Globals
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private di As DocumentInteraction
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.RootPanel.Color = Colors.Green
NavControl.ShowPage(Page1)
di.Initialize("di", File.DirAssets, "test.igo")
di.UTI = "com.instagram.exclusivegram"
End Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
End Sub
Private Sub Application_Background
End Sub
Sub Page1_Click
di.OpenFile(Page1.RootPanel)
End Sub
According to this hit:
http://blog.horizon.camera/post/102273431070/video-share-objc-ios-instagram
there are some undocumented URL schemes that allow you to directly share content.
I have experimented with URL schemes in a slightly different context and got it working but I cannot for the life of me work out how to use (as expressed in the above hit):
instagram://library?AssetPath=[URL ENCODED STRING OF PHOTO LIBRARY ASSET URL]
in B4i, so that I can share a jpg from DirAssets.
Any suggestions appreciated...