iOS Question Share in specific apps

hatzisn

Expert
Licensed User
Longtime User
Hi all,

is it possible to share text to specific apps defined by me with ActivityViewController or any other method?
 

hatzisn

Expert
Licensed User
Longtime User
No, I mean something like share to Facebook Messenger.
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
I tried with the following

{In main page}
#UrlScheme: whatsapp
#UrlScheme: viber

whatsapp://send?text=Hello%2C%20World!"
viber://forward?text=Hello%2C%20World!

code (for viber and whatsapp):
B4X:
    If Main.App.CanOpenURL("viber://forward?text=Hello%2C%20World!") Then
        Main.App.OpenURL("viber://forward?text=Hello%2C%20World!")
    Else
        hd.ToastMessageShow("App not present", True)
    End If

'And for whatsapp

    If Main.App.CanOpenURL("whatsapp://send?text=Hello%2C%20World!") Then
        Main.App.OpenURL("whatsapp://send?text=Hello%2C%20World!")
    Else
        hd.ToastMessageShow("App not present", True)
    End If


WhatsApp works, viber not
I looked for viber at: https://stackoverflow.com/questions...r-app-via-url-scheme-on-ios/43030670#43030670

For facebook messenger I have found the fb-messenger shceme but it doesn't seem to work and it only shares links as I've noticed in the relative pages.
For skype I have not managed to find a way to share text as the known uris in Stackoverflow are for calling only.

Anyone can help in this?
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
I did something similar 2 years ago. WhatsApp was alone, where it was possible to call by phone nomber and to pass a text.
Viber, Skype, Telegram, Messenger - maximum it was possible to activate wanted chat. More - some of them wanted UserId instead of phone nomber
 
Upvote 0

ykucuk

Well-Known Member
Licensed User
Longtime User
Hi all,

is it possible to share text to specific apps defined by me with ActivityViewController or any other method?
B4X:
Dim no As NativeObject = avc





    Dim excludedActivities As List


    excludedActivities.Initialize





    'Twitter, Weibo, Message, Mail, Print, Pasteboard, Assign To Contact, Camera Roll, Reading List, Flickr, Vimeo, Tencent Weibo, AirDrop, Freeform, Journal


    excludedActivities.Add("com.apple.UIKit.activity.PostToTwitter")


    excludedActivities.Add("com.apple.UIKit.activity.PostToWeibo")


    excludedActivities.Add("com.apple.UIKit.activity.Message")


    excludedActivities.Add("com.apple.UIKit.activity.Mail")


    excludedActivities.Add("com.apple.UIKit.activity.Print")


    excludedActivities.Add("com.apple.UIKit.activity.CopyToPasteboard")


    excludedActivities.Add("com.apple.UIKit.activity.AssignToContact")


    excludedActivities.Add("com.apple.UIKit.activity.SaveToCameraRoll")


    excludedActivities.Add("com.apple.UIKit.activity.AddToReadingList")


    excludedActivities.Add("com.apple.UIKit.activity.PostToFlickr")


    excludedActivities.Add("com.apple.UIKit.activity.PostToVimeo")


    excludedActivities.Add("com.apple.UIKit.activity.PostToTencentWeibo")


    excludedActivities.Add("com.apple.UIKit.activity.AirDrop")








    ' Reminders, Notes, Slideshow


    excludedActivities.Add("com.apple.reminders.sharingextension") ' Reminders


    excludedActivities.Add("com.apple.mobilenotes.SharingExtension") ' Notes


    excludedActivities.Add("com.apple.mobileslideshow.StreamShareService") ' Slideshow





    ' Eklenen aktiviteler


    excludedActivities.Add("com.apple.UIKit.activity.CollaborationCopyLink")


    excludedActivities.Add("com.apple.UIKit.activity.CollaborationInviteWithLink")


    excludedActivities.Add("com.apple.UIKit.activity.MarkupAsPDF")


    excludedActivities.Add("com.apple.UIKit.activity.OpenInIBooks")


    excludedActivities.Add("com.apple.UIKit.activity.PostToFacebook")


    excludedActivities.Add("com.apple.UIKit.activity.SharePlay")











    ' ExcludedActivityTypes'ı ayarla


    Dim no As NativeObject = avc


    no.SetField("excludedActivityTypes", excludedActivities)





    ' ActivityViewController'ı göster


    avc.Show(mp, mp.RootPanel)
 
Upvote 0
Top