0
CFMessagePort
을 사용하기 전에 iOS7 이상에서는 사용할 수 없지만 교체 된 방법이 있습니까? 나는 의 생성자를 hooking 할 때 CFMessagePort
을 시도했지만, 대부분의 어플리케이션에서는 성공적으로 CFMessagePortCreateLocal
을 리턴 할 수 없다. 단지 NULL을 반환한다. 나는 어딘가 잘못인가?iOS에서 응용 프로그램 간의 통신 방법은 무엇입니까?
static void setupUIApplicationMessagePort()
{
NSString *identifier = @"com.foo.foo.UIApplication";
CFMessagePortRef local = CFMessagePortCreateLocal(NULL, (__bridge CFStringRef)identifier, callBackForUIApplication, NULL, NULL);
if (local) {
NSLog(@"local OK: %@", local);
CFRunLoopSourceRef source = CFMessagePortCreateRunLoopSource(NULL, local, 0);
CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopCommonModes);
rocketbootstrap_cfmessageportexposelocal(local);
} else {
NSLog(@"local is NULL"); // in most of the apps it returns NULL
}
}
%ctor {
if(%c(UIApplication)) {
setupUIApplicationMessagePort();
}
}
가능한 [App 그룹과 앱 간 데이터 통신 및 지속] (http://stackoverflow.com/questions/24015506/communicating-and-persisting-data-between-apps-with-app-groups) – TCB13
URL : https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html – TCB13
이것은 탈옥 질문이므로 저수준 API가 필요합니다. – creker