[英]How to return to today extension from app
When the user taps the today extension it opens the app where they can modify its settings. 当用户点击Today扩展程序时,它将打开该应用程序,他们可以在其中修改其设置。 But when the app is exited, the user is returned to the home screen. 但是当退出应用程序时,用户将返回到主屏幕。 Is there any way I return focus to the today extension so the user can view the changes immediately? 我有什么办法可以将焦点恢复到今天的扩展,以便用户可以立即查看更改? Or is this just not possible in iOS? 还是这在iOS中是不可能的?
I recommend making a button to go to the app. 我建议点击一个按钮以转到该应用程序。 Or add transition functionality after applying settings. 或在应用设置后添加过渡功能。
like this 像这样
var instagramHooks = "instagram://user?username=johndoe"
var instagramUrl = NSURL(string: instagramHooks)
if UIApplication.sharedApplication().canOpenURL(instagramUrl!)
{
UIApplication.sharedApplication().openURL(instagramUrl!)
} else {
//redirect to safari because the user doesn't have Instagram
UIApplication.sharedApplication().openURL(NSURL(string: "http://instagram.com/")!)
}
User can click on the top left button to return if the application has been opened from another application. 用户可以单击左上方的按钮以返回是否已从另一个应用程序打开了该应用程序。 You can update the data on his return. 您可以在他返回时更新数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.