0

I read the pages in stackoverflow and I can understand that I can embed or redirect to Skype app from app I code, but I couldn't find how to make it on iOS even whether it's possible or not.

I want to redirect to skype triggered by pushing button in my iOS app(swift).Please teach me how to do that(If it is not possible, I also want to know that)

Thanks,

槇大河
  • 33
  • 1
  • 3

1 Answers1

4

when you build your app for iOS 9 and above and you need to call URL schemes, you will now need to declare them in your apps Info.plist. There is a new key LSApplicationQueriesSchemes.

enter image description here

you can do this in helps of canOpenURL:

Objective-C

NSURL *skype = [NSURL URLWithString:[NSString stringWithFormat:@"skype:"]]; .
if ([[UIApplication sharedApplication] canOpenURL:skype]) {
[[UIApplication sharedApplication] openURL:skype];
} else {
// skype not Installed in your Device
  [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.com/apps/skype/skype"]];  // or use https://itunes.apple.com/in/app/skype-for-iphone/id304878510?mt=8
}

Swift

var skype: NSURL = NSURL(string: String(format: "skype:"))! //add object skype like this
if UIApplication.sharedApplication().canOpenURL(skype) {
UIApplication.sharedApplication().openURL(skype)
 }
else {
// skype not Installed in your Device
   UIApplication.sharedApplication().openURL("http://itunes.com/apps/skype/skype")
}

for example see this link

Piyush Sanepara
  • 1,417
  • 2
  • 18
  • 23
Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143