스마트폰 BTC 채굴앱
https://get.cryptobrowser.site/34473645
Earn coins while browsing the web
Earn bitcoins while watching videos, chatting, or playing online. It has never been so easy to increase your income! Tell your friends about CryptoTab Browser, invite them to join, and earn more together. Grow your network—get more profit!
get.cryptobrowser.site
앱에서 앱으로 호출
Info.plist 설정 후 OpenURL함수를 통해 호출한다.
Info.plist 설정
- 호출하는 쪽 URL Scheme 설정 (샘플앱 명 : sendApp)
- 호출받는 쪽 URL Scheme 설정 (샘플앱 명 : receiveApp)
※ Xcode 11부터 SceneDelegate가 기본 iOS 앱 프로젝트 템플릿으로 자동으로 추가되면서 AppDelegate의 openURL 함수가 호출 되지 않으므로 SceneDelegate의 openURLContexts 함수에서 처리해야 한다.
// SceneDelegate.swift
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
if let url = URLContexts.first?.url {
print("url = \(url)")
}
}
// SceneDelegate.m
- (void)scene:(UIScene *)scene openURLContexts:(NSSet *)URLContexts {
UIOpenURLContext *context = URLContexts.anyObject;
NSURL *url = context.URL;
NSLog(@"url = %@",url);
}
// Swift 앱 호출 샘플코드
if UIApplication.shared.canOpenURL(url) {
if #available(iOS 10.0, *) {
UIApplication.shared.open(url, options: [:], completionHandler: { (success) in
})
} else {
UIApplication.shared.openURL(url)
}
}
// Objective-C 앱 호출 샘플코드
if (YES == [[UIApplication sharedApplication] canOpenURL:url]) {
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {}];
} else {
[[UIApplication sharedApplication] openURL:url];
}
return;
}
모바일 웹에서 앱 호출
- 웹 브라우저(사파리,크롬 등)을 통한 웹사이트에서 앱 호출
window.location = "receiveApp://";
- 웹뷰(WKWebView)를 통한 웹사이트에서 앱 호출
※ 주의 : 이 경우 해당 URL scheme이 호출될 때 직접 코드로 호출 해 주어야 한다.
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
guard let url = navigationAction.request.url else {
decisionHandler(.cancel)
return
}
if (url.absoluteString.hasPrefix("receiveApp://")) {
if UIApplication.shared.canOpenURL(url) {
if #available(iOS 10.0, *) {
UIApplication.shared.open(url, options: [:], completionHandler: { (success) in
})
} else {
UIApplication.shared.openURL(url)
}
}
decisionHandler(.cancel)
return
}
... 중간생략 ...
}
스마트폰 BTC 채굴앱
https://get.cryptobrowser.site/34473645
Earn coins while browsing the web
Earn bitcoins while watching videos, chatting, or playing online. It has never been so easy to increase your income! Tell your friends about CryptoTab Browser, invite them to join, and earn more together. Grow your network—get more profit!
get.cryptobrowser.site
2021/01/06 - [iOS/Swift] - String to CGFloat
2021/01/05 - [iOS/Tips] - SceneDelegate 포인터 구하기
2021/01/05 - [iOS/Tips] - 앱 호출 (URL scheme)
2020/12/24 - [OS/Mac OS X] - MacBook을 AP로 설정하는 방법
2020/12/18 - [Arduino] - Bit Rate, Baud Rate
2020/12/18 - [Arduino] - RS232 Serial 통신 불량체크
2020/12/17 - [OS/Mac OS X] - OpenSSL을 이용한 Key 정보 Text 변환
2020/12/17 - [프로그래밍/Java] - RSA 암복호화
2020/12/17 - [iOS/Tips] - URL query 파싱 및 json string 변환
2020/12/16 - [개발노트] - Code 128 Barcode의 Check Digit 계산방법
2020/12/15 - [iOS/Tips] - 디버깅 차단 처리 (Anti Debug)
'개발 > iOS' 카테고리의 다른 글
String to CGFloat (0) | 2021.01.06 |
---|---|
SceneDelegate 포인터 구하기 (0) | 2021.01.05 |
URL query 파싱 및 json string 변환 (0) | 2020.12.17 |
디버깅 차단 처리 (Anti Debug) (0) | 2020.12.15 |
bundle id 알아내기 (0) | 2020.12.14 |