에 이메일 링크를 통해 앱을 열어야한다는 요구 사항이 있습니다.이메일에서 iPhone 앱을 여는 방법은 무엇입니까?
이 들어나는 이메일 버튼 액션에 다음 코드를 사용하고
- (IBAction)sendMail:(id)sender {
// From within your active view controller
if([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *mailCont = [[MFMailComposeViewController alloc] init];
mailCont.mailComposeDelegate = self;// Required to invoke mailComposeController when send
[mailCont setSubject:@“Email];
[mailCont setToRecipients:[NSArray arrayWithObject:@"Receipts"]];
NSMutableString *mutableString=[[NSMutableString alloc] initWithString:@"Hi,<br>\n"];
[mutableString appendString:[NSString stringWithFormat:@"<br> <a href=\"PracticeExample://\">Open my app</a></br>"]];
NSString *emailBody =[NSString stringWithFormat:@"<html><body>%@</br></body></html>",mutableString];
[mailCont setMessageBody:emailBody isHTML:YES];
[self presentViewController:mailCont animated:YES completion:nil];
}
}
나는 사파리를 열지 않고 앱을 열고 표시되지 내 이메일에서 링크를 "내 앱을 엽니 다"를 클릭하면 "사파리가 페이지를 열 수 없습니다 ... .."텍스트.
사파리 주소 상자에서 웹 사이트 이름이 "PracticeExample //"으로 변경되면 "PracticeExample : //"으로 변경되면 내 앱이 열립니다.
참고 : "PracticeExample"은 Plist의 맞춤 URL 스키마에 다음 링크를 사용하여 등록합니다. http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
** 응용 프로그램은 장치에 설치되어 있지 않은 경우 앱 스토어를 여는 방법을 하나 개 더 질문? **