JackKirk Well-Known Member Licensed User Longtime User Mar 16, 2021 #1 Hi, I'm digging around in the weeds doing final tidy-up of a customer app that shares .jpg and .mp4 files with other apps. I'm using code similar to: B4X: ... Private UI_activityviewcontroller As ActivityViewController ... 'Share away UI_activityviewcontroller.Initialize("Event_UI_activityviewcontroller", Array(wrk_bmp)) UI_activityviewcontroller.Show(Showlist_page, Null) which works fine. I would like to add some analytics to my app so that it generates statistics on the apps that are shared with. Is there any way to do this? Thanks...
Hi, I'm digging around in the weeds doing final tidy-up of a customer app that shares .jpg and .mp4 files with other apps. I'm using code similar to: B4X: ... Private UI_activityviewcontroller As ActivityViewController ... 'Share away UI_activityviewcontroller.Initialize("Event_UI_activityviewcontroller", Array(wrk_bmp)) UI_activityviewcontroller.Show(Showlist_page, Null) which works fine. I would like to add some analytics to my app so that it generates statistics on the apps that are shared with. Is there any way to do this? Thanks...
JackKirk Well-Known Member Licensed User Longtime User Mar 17, 2021 #3 Erel, I've been digging a bit... UIActivityViewController seems to have a thing called a completionWithItemsHandler in which there appears to be a property(?) called activityType which looks like it can have values like ".postToFacebook" which may be what I am looking for. But I am hopelessly out of my depth. Below are a couple of links which may be useful: https://developer.apple.com/documentation/uikit/uiactivityviewcontroller/completionwithitemshandler https://www.swiftdevcenter.com/uiactivityviewcontroller-tutorial-by-example/ << look towards the bottom https://pinkstone.co.uk/how-to-share-things-with-a-uiactivityviewcontroller/ << this one looks quite good to my illiterate eye All these seem to be fairly recent articles so I am assuming we won't be running foul of any recent iOS "privacy" restrictions. If this can be done it would be really useful... Last edited: Mar 17, 2021 Upvote 0
Erel, I've been digging a bit... UIActivityViewController seems to have a thing called a completionWithItemsHandler in which there appears to be a property(?) called activityType which looks like it can have values like ".postToFacebook" which may be what I am looking for. But I am hopelessly out of my depth. Below are a couple of links which may be useful: https://developer.apple.com/documentation/uikit/uiactivityviewcontroller/completionwithitemshandler https://www.swiftdevcenter.com/uiactivityviewcontroller-tutorial-by-example/ << look towards the bottom https://pinkstone.co.uk/how-to-share-things-with-a-uiactivityviewcontroller/ << this one looks quite good to my illiterate eye All these seem to be fairly recent articles so I am assuming we won't be running foul of any recent iOS "privacy" restrictions. If this can be done it would be really useful...
JackKirk Well-Known Member Licensed User Longtime User Mar 17, 2021 #4 Oops... I was too quick to ask questions. When I looked in more detail thru my iOS app (and in my defence I hadn't been inside the beast in quite a while) I discovered that, as per: https://www.b4x.com/android/forum/t...pp-with-activityviewcontroller.73159/#content there is a _Complete event for the statement B4X: UI_activityviewcontroller.Initialize("Event_UI_activityviewcontroller", Array(wrk_bmp)) which is something like: B4X: Private Sub Event_UI_activityviewcontroller_Complete(Success As Boolean, ActivityType As String) Success is obvious and ActivityType gives me strings like: com.burbn.instagram.shareextension <<< if I share to Instagram com.apple.UIKit.activity.Message <<< if I share to iPhone Message app Which is what I need.... Upvote 0
Oops... I was too quick to ask questions. When I looked in more detail thru my iOS app (and in my defence I hadn't been inside the beast in quite a while) I discovered that, as per: https://www.b4x.com/android/forum/t...pp-with-activityviewcontroller.73159/#content there is a _Complete event for the statement B4X: UI_activityviewcontroller.Initialize("Event_UI_activityviewcontroller", Array(wrk_bmp)) which is something like: B4X: Private Sub Event_UI_activityviewcontroller_Complete(Success As Boolean, ActivityType As String) Success is obvious and ActivityType gives me strings like: com.burbn.instagram.shareextension <<< if I share to Instagram com.apple.UIKit.activity.Message <<< if I share to iPhone Message app Which is what I need....
Erel B4X founder Staff member Licensed User Longtime User Mar 17, 2021 #5 Well spotted. I didn't remember it. Upvote 0