shivram
shivram

Reputation: 469

Open Link on Twitter App IOS

I have created a mail template on mailchimp. It consists of a twitter link. But an IPad or an IPhone user clicks on the link from his/her mail, the twitter link opens in the browser instead of the twitter app.

This does not happen in Android.

Any workarounds?

Upvotes: 2

Views: 4195

Answers (2)

keji
keji

Reputation: 5990

If you use a custom URL <a href="twitter://" than other Android/Desktop devices won't be able to open it. Twitter doesn't redirect with standard URLs from Safari and they should. But they do offer a "Open in app" button at the top left.

So if you want you could add two buttons in the email. One specifically for iOS: twitter://status?id=373205208664272897 and one for other devices https://twitter.com/support/status/373205208664272897.

Or you could create a site that reads the user agent of the device than determines which URL to redirect to.

The third option is just leaving it alone given that it's not really such a big issue in the grand scheme.

Upvotes: 2

Daniel Storm
Daniel Storm

Reputation: 18898

NSString *stringURL = @"twitter://";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];

From iPhone URL Schemes.

Upvotes: 0

Related Questions