공유하기 | SNS 로그인, 외부 연동, 공유 | Appbox iOS SDK 가이드
공유하기
링크 또는 메시지 공유
AppBox.shared.share(message:completion:)
Swift
1
AppBox.shared.share(message: "저장했습니다") { value, error in
2
guard error == nil else { return }
3
print(value)
4
}
1
[AppBox.shared shareWithMessage:@"저장했습니다" completion:^(BOOL value, NSError *error) {
2
if (error) { return; }
3
NSLog(@"%d", value);
4
}];
Request 항목 정의
| Request 항목 | 필수여부 | 설명 | 기본값 |
|---|---|---|---|
message | 필수 | 공유할 텍스트 또는 URL | - |
completion | 필수 | 결과를 받는 콜백. 메인 스레드에서 한 번 호출됩니다 | - |
Response 항목 정의
| Response 결과값 | |
|---|---|
| 값 | Bool |
| 오류 | 실패 원인. NSError |
화면 필요. OS 공유 시트를 띄웁니다
웹 브릿지에서는 공유하기의 application.share입니다.