Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified InterAppCommunication/IACClient.h
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions InterAppCommunication/IACClient.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ - (NSInteger)NSErrorCodeForXCUErrorCode:(NSString*)code {
}

- (BOOL)isAppInstalled {
#ifdef TARGET_OS_X
return false;
#else
return [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@://Test", self.URLScheme]]];
#endif
}

- (void)performAction:(NSString*)action {
Expand Down
Empty file modified InterAppCommunication/IACDelegate.h
100644 → 100755
Empty file.
Empty file modified InterAppCommunication/IACManager.h
100644 → 100755
Empty file.
22 changes: 21 additions & 1 deletion InterAppCommunication/IACManager.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,18 @@ - (BOOL)handleOpenURL:(NSURL*)url {
IACSuccessBlock success = ^(NSDictionary *returnParams, BOOL cancelled) {
if (cancelled) {
if (parameters[kXCUCancel]) {
#ifdef TARGET_OS_X
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:parameters[kXCUCancel]]];
#else
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:parameters[kXCUCancel]]];
#endif
}
} else if (parameters[kXCUSuccess]) {
#ifdef TARGET_OS_X
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[parameters[kXCUSuccess] stringByAppendingURLParams:returnParams]]];
#else
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[parameters[kXCUSuccess] stringByAppendingURLParams:returnParams]]];
#endif
}
};

Expand All @@ -149,7 +157,11 @@ - (BOOL)handleOpenURL:(NSURL*)url {
kXCUErrorMessage: [error localizedDescription],
kIACErrorDomain: [error domain]
};
#ifdef TARGET_OS_X
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[parameters[kXCUError] stringByAppendingURLParams:errorParams]]];
#else
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[parameters[kXCUError] stringByAppendingURLParams:errorParams]]];
#endif
}
};

Expand All @@ -173,7 +185,11 @@ - (BOOL)handleOpenURL:(NSURL*)url {
kXCUErrorMessage: [NSString stringWithFormat:NSLocalizedString(@"'%@' is not an x-callback-url action supported by %@", nil), action, [self localizedAppName]],
kIACErrorDomain: IACErrorDomain
};
#ifdef TARGET_OS_X
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[parameters[kXCUError] stringByAppendingURLParams:errorParams]]];
#else
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[parameters[kXCUError] stringByAppendingURLParams:errorParams]]];
#endif
return YES;
}
}
Expand Down Expand Up @@ -220,8 +236,12 @@ - (void)sendIACRequest:(IACRequest*)request {
}

sessions[request.requestID] = request;


#ifdef TARGET_OS_X
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:final_url]];
#else
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:final_url]];
#endif
}


Expand Down
Empty file modified InterAppCommunication/IACRequest.h
100644 → 100755
Empty file.
Empty file modified InterAppCommunication/IACRequest.m
100644 → 100755
Empty file.
Empty file modified InterAppCommunication/NSString+IACExtensions.h
100644 → 100755
Empty file.
Empty file modified InterAppCommunication/NSString+IACExtensions.m
100644 → 100755
Empty file.