Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Commit

Permalink
feat(ios): use xcframework to include slices for all arch/flavor comb…
Browse files Browse the repository at this point in the history
…inations (#224)

* feat(ios): include xcframework vs framework

* build(ios): remove .framework, add .xcframework

The xcframework structure allows for all execution architectures on all
execution types to be supported, vs the single arch for all types limitations
of the previous framework structure

Co-authored-by: Mike Hardy <github@mikehardy.net>
  • Loading branch information
mikehardy committed Dec 31, 2020
1 parent 2c0d9b6 commit 3f8b4e2
Show file tree
Hide file tree
Showing 26 changed files with 434 additions and 3 deletions.
3 changes: 2 additions & 1 deletion RNNotifee.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Pod::Spec.new do |s|
Pod::UI.warn "RNNotifee: Using NotifeeCore from sources."
s.dependency 'NotifeeCore'
else
s.ios.vendored_frameworks = 'ios/NotifeeCore.framework'
s.ios.vendored_frameworks = 'ios/NotifeeCore.xcframework'
s.preserve_paths = 'ios/NotifeeCore.xcframework'
end
end
Binary file removed ios/NotifeeCore.framework/NotifeeCore
Binary file not shown.
57 changes: 57 additions & 0 deletions ios/NotifeeCore.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-maccatalyst</string>
<key>LibraryPath</key>
<string>NotifeeCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7</string>
<key>LibraryPath</key>
<string>NotifeeCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>NotifeeCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
//
// NotifeeCore.h
// NotifeeCore
//
// Copyright © 2020 Invertase. All rights reserved.
//

#import <Foundation/Foundation.h>

//! Project version number for NotifeeCore.
FOUNDATION_EXPORT double NotifeeCoreVersionNumber;

//! Project version string for NotifeeCore.
FOUNDATION_EXPORT const unsigned char NotifeeCoreVersionString[];

// Import all the public headers of your framework using statements like #import <NotifeeCore/PublicHeader.h>
// #import <NotifeeCore/Example.h>
// END public headers import

NS_ASSUME_NONNULL_BEGIN

typedef void (^notifeeMethodVoidBlock)(NSError *_Nullable);

typedef void (^notifeeMethodNSDictionaryBlock)(NSError *_Nullable, NSDictionary *_Nullable);

typedef void (^notifeeMethodNSArrayBlock)(NSError *_Nullable, NSArray *_Nullable);

typedef void (^notifeeMethodBooleanBlock)(NSError *_Nullable, BOOL);

typedef void (^notifeeMethodNSIntegerBlock)(NSError *_Nullable, NSInteger);

typedef NS_ENUM(NSInteger, NotifeeCoreNotificationType) {
NotifeeCoreNotificationTypeAll = 0,
NotifeeCoreNotificationTypeDisplayed = 1,
NotifeeCoreNotificationTypeTrigger = 2
};

typedef NS_ENUM(NSInteger, NotifeeCoreEventType) {
NotifeeCoreEventTypeDismissed = 0,
NotifeeCoreEventTypeDelivered = 3,
NotifeeCoreEventTypeTriggerNotificationCreated = 7,
};

@class NotifeeCore;

@protocol NotifeeCoreDelegate <NSObject>
@optional
- (void) didReceiveNotifeeCoreEvent:(NSDictionary *_Nonnull)event;
@end

@interface NotifeeCore : NSObject

+ (void)setCoreDelegate:(id <NotifeeCoreDelegate>)coreDelegate;

+ (void)cancelNotification:(NSString *)notificationId withNotificationType: (NSInteger)notificationType withBlock:(notifeeMethodVoidBlock)block;

+ (void)cancelAllNotifications:(NSInteger)notificationType
withBlock:(notifeeMethodVoidBlock)block;

+ (void)displayNotification:(NSDictionary *)notification withBlock:(notifeeMethodVoidBlock)block;

+ (void)createTriggerNotification:(NSDictionary *)notification withTrigger: (NSDictionary *)trigger withBlock:(notifeeMethodVoidBlock)block;

+ (void)getTriggerNotificationIds:(notifeeMethodNSArrayBlock)block;

+ (void)requestPermission:(NSDictionary *)permissions withBlock:(notifeeMethodNSDictionaryBlock)block;

+ (void)getNotificationCategories:(notifeeMethodNSArrayBlock)block;

+ (void)setNotificationCategories:(NSArray<NSDictionary *> *)categories withBlock:(notifeeMethodVoidBlock)block;

+ (void)getNotificationSettings:(notifeeMethodNSDictionaryBlock)block;

+ (void)getInitialNotification:(notifeeMethodNSDictionaryBlock)block;

+ (void)setBadgeCount:(NSInteger)count withBlock:(notifeeMethodVoidBlock)block;

+ (void)getBadgeCount:(notifeeMethodNSIntegerBlock)block;

+ (void)incrementBadgeCount:(NSInteger)incrementBy withBlock:(notifeeMethodVoidBlock)block;

+ (void)decrementBadgeCount:(NSInteger)decrementBy withBlock:(notifeeMethodVoidBlock)block;

@end

NS_ASSUME_NONNULL_END
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
framework module NotifeeCore {
umbrella header "NotifeeCore.h"

export *
module * { export * }
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Headers/NotifeeCore.h</key>
<data>
IriPMUbF8yGl8NwezC6oVSU1JI8=
</data>
<key>Info.plist</key>
<data>
L/jfhngEvWGkHvmQ8Phg1vZe/FM=
</data>
<key>Modules/module.modulemap</key>
<data>
MofbqSkyMhKzIThesvSW+evCWII=
</data>
</dict>
<key>files2</key>
<dict>
<key>Headers/NotifeeCore.h</key>
<dict>
<key>hash</key>
<data>
IriPMUbF8yGl8NwezC6oVSU1JI8=
</data>
<key>hash2</key>
<data>
H4nTleBI43WtYeV33EmBdpiJp+I4ci2c+2RcBKEOzn8=
</data>
</dict>
<key>Modules/module.modulemap</key>
<dict>
<key>hash</key>
<data>
MofbqSkyMhKzIThesvSW+evCWII=
</data>
<key>hash2</key>
<data>
L+h3g7appet4YlYpsfktwVg9oRvUvqNvmOEKc9fcWLQ=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
//
// NotifeeCore.h
// NotifeeCore
//
// Copyright © 2020 Invertase. All rights reserved.
//

#import <Foundation/Foundation.h>

//! Project version number for NotifeeCore.
FOUNDATION_EXPORT double NotifeeCoreVersionNumber;

//! Project version string for NotifeeCore.
FOUNDATION_EXPORT const unsigned char NotifeeCoreVersionString[];

// Import all the public headers of your framework using statements like #import <NotifeeCore/PublicHeader.h>
// #import <NotifeeCore/Example.h>
// END public headers import

NS_ASSUME_NONNULL_BEGIN

typedef void (^notifeeMethodVoidBlock)(NSError *_Nullable);

typedef void (^notifeeMethodNSDictionaryBlock)(NSError *_Nullable, NSDictionary *_Nullable);

typedef void (^notifeeMethodNSArrayBlock)(NSError *_Nullable, NSArray *_Nullable);

typedef void (^notifeeMethodBooleanBlock)(NSError *_Nullable, BOOL);

typedef void (^notifeeMethodNSIntegerBlock)(NSError *_Nullable, NSInteger);

typedef NS_ENUM(NSInteger, NotifeeCoreNotificationType) {
NotifeeCoreNotificationTypeAll = 0,
NotifeeCoreNotificationTypeDisplayed = 1,
NotifeeCoreNotificationTypeTrigger = 2
};

typedef NS_ENUM(NSInteger, NotifeeCoreEventType) {
NotifeeCoreEventTypeDismissed = 0,
NotifeeCoreEventTypeDelivered = 3,
NotifeeCoreEventTypeTriggerNotificationCreated = 7,
};

@class NotifeeCore;

@protocol NotifeeCoreDelegate <NSObject>
@optional
- (void) didReceiveNotifeeCoreEvent:(NSDictionary *_Nonnull)event;
@end

@interface NotifeeCore : NSObject

+ (void)setCoreDelegate:(id <NotifeeCoreDelegate>)coreDelegate;

+ (void)cancelNotification:(NSString *)notificationId withNotificationType: (NSInteger)notificationType withBlock:(notifeeMethodVoidBlock)block;

+ (void)cancelAllNotifications:(NSInteger)notificationType
withBlock:(notifeeMethodVoidBlock)block;

+ (void)displayNotification:(NSDictionary *)notification withBlock:(notifeeMethodVoidBlock)block;

+ (void)createTriggerNotification:(NSDictionary *)notification withTrigger: (NSDictionary *)trigger withBlock:(notifeeMethodVoidBlock)block;

+ (void)getTriggerNotificationIds:(notifeeMethodNSArrayBlock)block;

+ (void)requestPermission:(NSDictionary *)permissions withBlock:(notifeeMethodNSDictionaryBlock)block;

+ (void)getNotificationCategories:(notifeeMethodNSArrayBlock)block;

+ (void)setNotificationCategories:(NSArray<NSDictionary *> *)categories withBlock:(notifeeMethodVoidBlock)block;

+ (void)getNotificationSettings:(notifeeMethodNSDictionaryBlock)block;

+ (void)getInitialNotification:(notifeeMethodNSDictionaryBlock)block;

+ (void)setBadgeCount:(NSInteger)count withBlock:(notifeeMethodVoidBlock)block;

+ (void)getBadgeCount:(notifeeMethodNSIntegerBlock)block;

+ (void)incrementBadgeCount:(NSInteger)incrementBy withBlock:(notifeeMethodVoidBlock)block;

+ (void)decrementBadgeCount:(NSInteger)decrementBy withBlock:(notifeeMethodVoidBlock)block;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
framework module NotifeeCore {
umbrella header "NotifeeCore.h"

export *
module * { export * }
}
Binary file not shown.

0 comments on commit 3f8b4e2

Please sign in to comment.