Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPM Support #347

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ Carthage/Build

## AppCode
.idea/
.build
.swiftpm
4 changes: 4 additions & 0 deletions Bolts/iOS/BFAppLink.h → Bolts-iOS/BFAppLink.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import <Foundation/Foundation.h>

/*! The version of the App Link protocol that this library supports */
Expand Down Expand Up @@ -47,3 +49,5 @@ FOUNDATION_EXPORT NSString *const BFAppLinkVersion;
@property (nonatomic, strong, readonly) NSURL *webURL;

@end

#endif
5 changes: 5 additions & 0 deletions Bolts/iOS/BFAppLink.m → Bolts-iOS/BFAppLink.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import "BFAppLink_Internal.h"

NSString *const BFAppLinkDataParameterName = @"al_applink_data";
Expand Down Expand Up @@ -60,3 +62,6 @@ - (BFAppLink *)initWithIsBackToReferrer:(BOOL)backToReferrer {
}

@end


#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import <Foundation/Foundation.h>

#import <Bolts/BFAppLink.h>
#import "BFAppLink.h"

/*!
The result of calling navigate on a BFAppLinkNavigation
Expand Down Expand Up @@ -112,3 +114,5 @@ NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension")
+ (void)setDefaultResolver:(id<BFAppLinkResolving>)resolver;

@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@
*
*/

#import "BFAppLinkNavigation.h"
#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import <UIKit/UIKit.h>

#if SWIFT_PACKAGE
#import "../Bolts/Bolts.h"
#else
#import <Bolts/Bolts.h>
#endif

#import "BFAppLinkNavigation.h"
#import "BFAppLinkTarget.h"
#import "BFMeasurementEvent_Internal.h"
#import "BFAppLink_Internal.h"
#import "BFWebViewAppLinkResolver.h"

FOUNDATION_EXPORT NSString *const BFAppLinkDataParameterName;
FOUNDATION_EXPORT NSString *const BFAppLinkTargetKeyName;
Expand Down Expand Up @@ -282,3 +291,5 @@ + (void)setDefaultResolver:(id<BFAppLinkResolving>)resolver {
}

@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import <Foundation/Foundation.h>

@class BFTask;
Expand All @@ -28,3 +30,5 @@
- (BFTask *)appLinkFromURLInBackground:(NSURL *)url NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension");

@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import <Bolts/BFAppLinkReturnToRefererView.h>

#import "BFAppLinkReturnToRefererView.h"

@class BFAppLink;
@class BFAppLinkReturnToRefererController;
Expand Down Expand Up @@ -86,3 +89,5 @@ NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension")
- (void)closeViewAnimated:(BOOL)animated;

@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import "BFAppLinkReturnToRefererController.h"

#import "BFAppLink.h"
Expand Down Expand Up @@ -228,3 +230,5 @@ - (void)openRefererAppLink:(BFAppLink *)refererAppLink {
}

@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import <Foundation/Foundation.h>

#import <UIKit/UIKit.h>

#import <Bolts/BFAppLinkNavigation.h>
#import "BFAppLinkNavigation.h"

@class BFAppLinkReturnToRefererView;
@class BFURL;
Expand Down Expand Up @@ -76,3 +79,5 @@ NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension")
@property (nonatomic, assign) BOOL closed;

@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import "BFAppLinkReturnToRefererView.h"

#import "BFAppLink.h"
Expand Down Expand Up @@ -244,7 +246,7 @@ - (NSString *)localizedLabelForReferer:(NSString *)refererName {
return nil;
}

NSString *format = NSLocalizedString(@"Touch to return to %1$@", @"Format for the string to return to a calling app.");
NSString *format = @"Touch to return to %1$@";

return [NSString stringWithFormat:format, refererName];
}
Expand All @@ -266,3 +268,5 @@ - (void)updateHidden {
}

@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
*
*/

#import <Bolts/BFAppLinkReturnToRefererView.h>
#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import "BFAppLinkReturnToRefererView.h"

@interface BFAppLinkReturnToRefererView (Internal)

- (CGFloat)statusBarHeight;

@end

#endif
4 changes: 4 additions & 0 deletions Bolts/iOS/BFAppLinkTarget.h → Bolts-iOS/BFAppLinkTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import <Foundation/Foundation.h>

/*!
Expand All @@ -31,3 +33,5 @@
@property (nonatomic, copy, readonly) NSString *appName;

@end

#endif
4 changes: 4 additions & 0 deletions Bolts/iOS/BFAppLinkTarget.m → Bolts-iOS/BFAppLinkTarget.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import "BFAppLinkTarget.h"

@interface BFAppLinkTarget ()
Expand All @@ -31,3 +33,5 @@ + (instancetype)appLinkTargetWithURL:(NSURL *)url
}

@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
*
*/

#import <Bolts/BFAppLink.h>
#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import "BFAppLink.h"

FOUNDATION_EXPORT NSString *const BFAppLinkDataParameterName;
FOUNDATION_EXPORT NSString *const BFAppLinkTargetKeyName;
Expand All @@ -30,3 +32,6 @@ FOUNDATION_EXPORT NSString *const BFAppLinkRefererUrl;
@property (nonatomic, assign, readonly, getter=isBackToReferrer) BOOL backToReferrer;

@end


#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import <Foundation/Foundation.h>

/*! The name of the notification posted by BFMeasurementEvent */
Expand Down Expand Up @@ -43,3 +45,5 @@ FOUNDATION_EXPORT NSString *const BFAppLinkNavigateBackToReferrerEventName;
@interface BFMeasurementEvent : NSObject

@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import "BFMeasurementEvent_Internal.h"

NSString *const BFMeasurementEventNotificationName = @"com.parse.bolts.measurement_event";
Expand All @@ -23,7 +25,7 @@
NSString *const BFAppLinkNavigateOutEventName = @"al_nav_out";
NSString *const BFAppLinkNavigateBackToReferrerEventName = @"al_ref_back_out";

__attribute__((noinline)) void warnOnMissingEventName() {
__attribute__((noinline)) void warnOnMissingEventName(void) {
NSLog(@"Warning: Missing event name when logging bolts measurement event. \n"
" Ignoring this event in logging.");
}
Expand Down Expand Up @@ -60,3 +62,5 @@ + (void)postNotificationForEventName:(NSString *)name args:(NSDictionary *)args
}

@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
*
*/

#import <Bolts/BFMeasurementEvent.h>
#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import "BFMeasurementEvent.h"
/*!
Provides methods for posting notifications from the Bolts framework
*/
Expand All @@ -17,3 +19,5 @@
+ (void)postNotificationForEventName:(NSString *)name args:(NSDictionary *)args;

@end

#endif
4 changes: 4 additions & 0 deletions Bolts/iOS/BFURL.h → Bolts-iOS/BFURL.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import <Foundation/Foundation.h>

@class BFAppLink;
Expand Down Expand Up @@ -73,3 +75,5 @@
@property (nonatomic, strong, readonly) NSDictionary *inputQueryParameters;

@end

#endif
4 changes: 4 additions & 0 deletions Bolts/iOS/BFURL.m → Bolts-iOS/BFURL.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import "BFURL_Internal.h"
#import "BFAppLink_Internal.h"
#import "BFAppLinkTarget.h"
Expand Down Expand Up @@ -140,3 +142,5 @@ + (NSDictionary *)queryParametersForURL:(NSURL *)url {
}

@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
*
*/

#import <Bolts/BFURL.h>
#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import "BFURL.h"

@interface BFURL (Internal)
+ (BFURL *)URLForRenderBackToReferrerBarURL:(NSURL *)url;
@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
*
*/

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import <Foundation/Foundation.h>

#import <Bolts/BFAppLinkResolving.h>
#import "BFAppLinkResolving.h"

/*!
A reference implementation for an App Link resolver that uses a hidden WKWebView
Expand All @@ -25,3 +27,4 @@

@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,24 @@
*
*/

#import <WebKit/WebKit.h>
#if TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV

#import <WebKit/WebKit.h>
#import "BFWebViewAppLinkResolver.h"
#import "BFAppLink.h"
#import "BFAppLinkTarget.h"

#if SWIFT_PACKAGE
#import "../Bolts/BFTask.h"
#import "../Bolts/BFTaskCompletionSource.h"
#import "../Bolts/BFExecutor.h"
#else
#import "BFTask.h"
#import "BFTaskCompletionSource.h"
#import "BFExecutor.h"
#endif



// Defines JavaScript to extract app link tags from HTML content
static NSString *const BFWebViewAppLinkResolverTagExtractionJavaScript = @""
Expand Down Expand Up @@ -308,3 +318,5 @@ - (BFAppLink *)appLinkFromALData:(NSDictionary *)appLinkDict destination:(NSURL
}

@end

#endif
Loading