diff --git a/FirebaseAnalytics.framework/FirebaseAnalytics b/frameworks/FirebaseAnalytics.framework/FirebaseAnalytics similarity index 100% rename from FirebaseAnalytics.framework/FirebaseAnalytics rename to frameworks/FirebaseAnalytics.framework/FirebaseAnalytics diff --git a/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h b/frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h similarity index 100% rename from FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h rename to frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h diff --git a/FirebaseAnalytics.framework/Headers/FIRAnalytics.h b/frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h similarity index 100% rename from FirebaseAnalytics.framework/Headers/FIRAnalytics.h rename to frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h diff --git a/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h b/frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h similarity index 100% rename from FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h rename to frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h diff --git a/FirebaseAnalytics.framework/Headers/FIRApp.h b/frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h similarity index 100% rename from FirebaseAnalytics.framework/Headers/FIRApp.h rename to frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h diff --git a/FirebaseAnalytics.framework/Headers/FIRConfiguration.h b/frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h similarity index 100% rename from FirebaseAnalytics.framework/Headers/FIRConfiguration.h rename to frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h diff --git a/FirebaseAnalytics.framework/Headers/FIREventNames.h b/frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h similarity index 100% rename from FirebaseAnalytics.framework/Headers/FIREventNames.h rename to frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h diff --git a/FirebaseAnalytics.framework/Headers/FIROptions.h b/frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h similarity index 100% rename from FirebaseAnalytics.framework/Headers/FIROptions.h rename to frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h diff --git a/FirebaseAnalytics.framework/Headers/FIRParameterNames.h b/frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h similarity index 100% rename from FirebaseAnalytics.framework/Headers/FIRParameterNames.h rename to frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h diff --git a/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h b/frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h similarity index 100% rename from FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h rename to frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h diff --git a/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h b/frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h similarity index 100% rename from FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h rename to frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h diff --git a/FirebaseAnalytics.framework/Modules/module.modulemap b/frameworks/FirebaseAnalytics.framework/Modules/module.modulemap similarity index 100% rename from FirebaseAnalytics.framework/Modules/module.modulemap rename to frameworks/FirebaseAnalytics.framework/Modules/module.modulemap diff --git a/frameworks/FirebaseInstanceID.framework/FirebaseInstanceID b/frameworks/FirebaseInstanceID.framework/FirebaseInstanceID new file mode 100755 index 0000000000000000000000000000000000000000..3f3b280de16b265372abd5d0089fb1c9dfcc4e94 Binary files /dev/null and b/frameworks/FirebaseInstanceID.framework/FirebaseInstanceID differ diff --git a/frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h b/frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h new file mode 100644 index 0000000000000000000000000000000000000000..717e290aa56e4acf246294868b42d52a3d7834c0 --- /dev/null +++ b/frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h @@ -0,0 +1,245 @@ +#import + +/** + * @memberof FIRInstanceID + * + * The scope to be used when fetching/deleting a token for Firebase Messaging. + */ +FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDScopeFirebaseMessaging; + +/** + * Called when the system determines that tokens need to be refreshed. + * This method is also called if Instance ID has been reset in which + * case, tokens and FCM topic subscriptions also need to be refreshed. + * + * Instance ID service will throttle the refresh event across all devices + * to control the rate of token updates on application servers. + */ +FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDTokenRefreshNotification; + +/** + * @related FIRInstanceID + * + * The completion handler invoked when the InstanceID token returns. If + * the call fails we return the appropriate `error code` as described below. + * + * @param token The valid token as returned by InstanceID backend. + * + * @param error The error describing why generating a new token + * failed. See the error codes below for a more detailed + * description. + */ +typedef void(^FIRInstanceIDTokenHandler)( NSString * __nullable token, NSError * __nullable error); + + +/** + * @related FIRInstanceID + * + * The completion handler invoked when the InstanceID `deleteToken` returns. If + * the call fails we return the appropriate `error code` as described below + * + * @param error The error describing why deleting the token failed. + * See the error codes below for a more detailed description. + */ +typedef void(^FIRInstanceIDDeleteTokenHandler)(NSError * __nullable error); + +/** + * @related FIRInstanceID + * + * The completion handler invoked when the app identity is created. If the + * identity wasn't created for some reason we return the appropriate error code. + * + * @param identity A valid identity for the app instance, nil if there was an error + * while creating an identity. + * @param error The error if fetching the identity fails else nil. + */ +typedef void(^FIRInstanceIDHandler)(NSString * __nullable identity, NSError * __nullable error); + +/** + * @related FIRInstanceID + * + * The completion handler invoked when the app identity and all the tokens associated + * with it are deleted. Returns a valid error object in case of failure else nil. + * + * @param error The error if deleting the identity and all the tokens associated with + * it fails else nil. + */ +typedef void(^FIRInstanceIDDeleteHandler)(NSError * __nullable error); + +/** + * @enum FIRInstanceIDError + */ +typedef NS_ENUM(NSUInteger, FIRInstanceIDError) { + // Http related errors. + + /// Unknown error. + FIRInstanceIDErrorUnknown = 0, + + /// Auth Error -- GCM couldn't validate request from this client. + FIRInstanceIDErrorAuthentication = 1, + + /// NoAccess -- InstanceID service cannot be accessed. + FIRInstanceIDErrorNoAccess = 2, + + /// Timeout -- Request to InstanceID backend timed out. + FIRInstanceIDErrorTimeout = 3, + + /// Network -- No network available to reach the servers. + FIRInstanceIDErrorNetwork = 4, + + /// OperationInProgress -- Another similar operation in progress, + /// bailing this one. + FIRInstanceIDErrorOperationInProgress = 5, + + /// InvalidRequest -- Some parameters of the request were invalid. + FIRInstanceIDErrorInvalidRequest = 7, +}; + +/** + * The APNS token type for the app. If the token type is set to `UNKNOWN` + * InstanceID will implicitly try to figure out what the actual token type + * is from the provisioning profile. + */ +typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) { + /// Unknown token type. + FIRInstanceIDAPNSTokenTypeUnknown, + /// Sandbox token type. + FIRInstanceIDAPNSTokenTypeSandbox, + /// Production token type. + FIRInstanceIDAPNSTokenTypeProd, +}; + +/** + * Instance ID provides a unique identifier for each app instance and a mechanism + * to authenticate and authorize actions (for example, sending a GCM message). + * + * Instance ID is long lived but, may be reset if the device is not used for + * a long time or the Instance ID service detects a problem. + * If Instance ID is reset, the app will be notified with a `com.firebase.iid.token-refresh` + * notification. + * + * If the Instance ID has become invalid, the app can request a new one and + * send it to the app server. + * To prove ownership of Instance ID and to allow servers to access data or + * services associated with the app, call + * `[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler]`. + */ +@interface FIRInstanceID : NSObject + +/** + * FIRInstanceID. + * + * @return A shared instance of FIRInstanceID. + */ ++ (nonnull instancetype)instanceID NS_SWIFT_NAME(instanceID()); + +/** + * Unavailable. Use +instanceID instead. + */ +- (nonnull instancetype)init __attribute__((unavailable("Use +instanceID instead."))); + +/** + * Set APNS token for the application. This APNS token will be used to register + * with Firebase Messaging using `token` or + * `tokenWithAuthorizedEntity:scope:options:handler`. If the token type is set to + * `FIRInstanceIDAPNSTokenTypeUnknown` InstanceID will read the provisioning profile + * to find out the token type. + * + * @param token The APNS token for the application. + * @param type The APNS token type for the above token. + */ +- (void)setAPNSToken:(nonnull NSData *)token + type:(FIRInstanceIDAPNSTokenType)type; + +#pragma mark - Tokens + +/** + * Returns a Firebase Messaging scoped token for the firebase app. + * + * @return Null Returns null if the device has not yet been registerd with + * Firebase Message else returns a valid token. + */ +- (nullable NSString *)token; + +/** + * Returns a token that authorizes an Entity (example: cloud service) to perform + * an action on behalf of the application identified by Instance ID. + * + * This is similar to an OAuth2 token except, it applies to the + * application instance instead of a user. + * + * This is an asynchronous call. If the token fetching fails for some reason + * we invoke the completion callback with nil `token` and the appropriate + * error. + * + * Note, you can only have one `token` or `deleteToken` call for a given + * authorizedEntity and scope at any point of time. Making another such call with the + * same authorizedEntity and scope before the last one finishes will result in an + * error with code `OperationInProgress`. + * + * @see FIRInstanceID deleteTokenWithAuthorizedEntity:scope:handler: + * + * @param authorizedEntity Entity authorized by the token. + * @param scope Action authorized for authorizedEntity. + * @param options The extra options to be sent with your token request. The + * value for the `apns_token` should be the NSData object + * passed to UIApplication's + * `didRegisterForRemoteNotificationsWithDeviceToken` method. + * All other keys and values in the options dict need to be + * instances of NSString or else they will be discarded. Bundle + * keys starting with 'GCM.' and 'GOOGLE.' are reserved. + * @param handler The callback handler which is invoked when the token is + * successfully fetched. In case of success a valid `token` and + * `nil` error are returned. In case of any error the `token` + * is nil and a valid `error` is returned. The valid error + * codes have been documented above. + */ +- (void)tokenWithAuthorizedEntity:(nonnull NSString *)authorizedEntity + scope:(nonnull NSString *)scope + options:(nullable NSDictionary *)options + handler:(nonnull FIRInstanceIDTokenHandler)handler; + +/** + * Revokes access to a scope (action) for an entity previously + * authorized by `[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler]`. + * + * This is an asynchronous call. Call this on the main thread since InstanceID lib + * is not thread safe. In case token deletion fails for some reason we invoke the + * `handler` callback passed in with the appropriate error code. + * + * Note, you can only have one `token` or `deleteToken` call for a given + * authorizedEntity and scope at a point of time. Making another such call with the + * same authorizedEntity and scope before the last one finishes will result in an error + * with code `OperationInProgress`. + * + * @param authorizedEntity Entity that must no longer have access. + * @param scope Action that entity is no longer authorized to perform. + * @param handler The handler that is invoked once the unsubscribe call ends. + * In case of error an appropriate error object is returned + * else error is nil. + */ +- (void)deleteTokenWithAuthorizedEntity:(nonnull NSString *)authorizedEntity + scope:(nonnull NSString *)scope + handler:(nonnull FIRInstanceIDDeleteTokenHandler)handler; + +#pragma mark - Identity + +/** + * Asynchronously fetch a stable identifier that uniquely identifies the app + * instance. If the identifier has been revoked or has expired, this method will + * return a new identifier. + * + * + * @param handler The handler to invoke once the identifier has been fetched. + * In case of error an appropriate error object is returned else + * a valid identifier is returned and a valid identifier for the + * application instance. + */ +- (void)getIDWithHandler:(nonnull FIRInstanceIDHandler)handler; + +/** + * Resets Instance ID and revokes all tokens. + */ +- (void)deleteIDWithHandler:(nonnull FIRInstanceIDDeleteHandler)handler; + +@end diff --git a/frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h b/frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h new file mode 100644 index 0000000000000000000000000000000000000000..053ec2b1cf31a9a15a1216b0c97ccf361d7476ad --- /dev/null +++ b/frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h @@ -0,0 +1 @@ +#import "FIRInstanceID.h" diff --git a/frameworks/FirebaseInstanceID.framework/Modules/module.modulemap b/frameworks/FirebaseInstanceID.framework/Modules/module.modulemap new file mode 100644 index 0000000000000000000000000000000000000000..b4a5b5e39728565f306f8c49c5f889698a774655 --- /dev/null +++ b/frameworks/FirebaseInstanceID.framework/Modules/module.modulemap @@ -0,0 +1,8 @@ +framework module FirebaseInstanceID { + + export * + + umbrella header "FirebaseInstanceID.h" + + header "FIRInstanceID.h" +} diff --git a/frameworks/FirebaseMessaging.framework/FirebaseMessaging b/frameworks/FirebaseMessaging.framework/FirebaseMessaging new file mode 100755 index 0000000000000000000000000000000000000000..b949b8b53f8ab3d4d00374fc04aedd814222ee47 Binary files /dev/null and b/frameworks/FirebaseMessaging.framework/FirebaseMessaging differ diff --git a/frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h b/frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h new file mode 100644 index 0000000000000000000000000000000000000000..b8164c4a92ed94a9242b278a5fc2361d37bad77a --- /dev/null +++ b/frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h @@ -0,0 +1,205 @@ +#import + +/** + * The completion handler invoked once the data connection with FIRMessaging is + * established. The data connection is used to send a continous stream of + * data and all the FIRMessaging data notifications arrive through this connection. + * Once the connection is established we invoke the callback with `nil` error. + * Correspondingly if we get an error while trying to establish a connection + * we invoke the handler with an appropriate error object and do an + * exponential backoff to try and connect again unless successful. + * + * @param error The error object if any describing why the data connection + * to FIRMessaging failed. + */ +typedef void(^FIRMessagingConnectCompletion)(NSError * __nullable error); + +/** + * Notification sent when the upstream message has been delivered + * successfully to the server. The notification object will be the messageID + * of the successfully delivered message. + */ +FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendSuccessNotification; + +/** + * Notification sent when the upstream message was failed to be sent to the + * server. The notification object will be the messageID of the failed + * message. The userInfo dictionary will contain the relevant error + * information for the failure. + */ +FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendErrorNotification; + +/** + * Notification sent when the Firebase messaging server deletes pending + * messages due to exceeded storage limits. This may occur, for example, when + * the device cannot be reached for an extended period of time. + * + * It is recommended to retrieve any missing messages directly from the + * server. + */ +FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingMessagesDeletedNotification; + +/** + * @enum FIRMessagingError + */ +typedef NS_ENUM(NSUInteger, FIRMessagingError) { + // Unknown error. + FIRMessagingErrorUnknown = 0, + + // Auth Error -- FIRMessaging couldn't validate request from this client. + FIRMessagingErrorAuthentication = 1, + + // NoAccess -- InstanceID service cannot be accessed. + FIRMessagingErrorNoAccess = 2, + + // Timeout -- Request to InstanceID backend timed out. + FIRMessagingErrorTimeout = 3, + + // Network -- No network available to reach the servers. + FIRMessagingErrorNetwork = 4, + + // OperationInProgress -- Another similar operation in progress, + // bailing this one. + FIRMessagingErrorOperationInProgress = 5, + + // InvalidRequest -- Some parameters of the request were invalid. + FIRMessagingErrorInvalidRequest = 7, +}; + +/// Status for the downstream message received by the app. +typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { + FIRMessagingMessageStatusUnknown, + /// New downstream message received by the app. + FIRMessagingMessageStatusNew, +}; + +/// Information about a downstream message received by the app. +@interface FIRMessagingMessageInfo : NSObject + +@property(nonatomic, readonly, assign) FIRMessagingMessageStatus status; + +@end + +/** + * Firebase Messaging enables apps to communicate with their app servers + * using simple messages. + * + * To send or receive messages, the app must get a + * registration token from GGLInstanceID, which authorizes an + * app server to send messages to an app instance. Pass your sender ID and + * `kGGLInstanceIDScopeFIRMessaging` as parameters to the method. + * + * A sender ID is a project number created when you configure your API project. + * It is labeled "Project Number" in the Google Developers Console. + * + * In order to receive FIRMessaging messages, declare application:didReceiveRemoteNotification: + * + * Client apps can send upstream messages back to the app server using the XMPP-based + * Cloud Connection Server, + * + */ +@interface FIRMessaging : NSObject + +/** + * FIRMessaging + * + * @return An instance of FIRMessaging. + */ ++ (nonnull instancetype)messaging NS_SWIFT_NAME(messaging()); + +/** + * Unavailable. Use +messaging instead. + */ +- (nonnull instancetype)init __attribute__((unavailable("Use +messaging instead."))); + +#pragma mark - Connect + +/** + * Create a FIRMessaging data connection which will be used to send the data notifications + * send by your server. It will also be used to send ACKS and other messages based + * on the FIRMessaging ACKS and other messages based on the FIRMessaging protocol. + * + * Use the `disconnect` method to disconnect the connection. + * + * @see FIRMessagingService disconnect + * + * @param handler The handler to be invoked once the connection is established. + * If the connection fails we invoke the handler with an + * appropriate error code letting you know why it failed. At + * the same time, FIRMessaging performs exponential backoff to retry + * establishing a connection and invoke the handler when successful. + */ +- (void)connectWithCompletion:(nonnull FIRMessagingConnectCompletion)handler; + +/** + * Disconnect the current FIRMessaging data connection. This stops any attempts to + * connect to FIRMessaging. Calling this on an already disconnected client is a no-op. + * + * Call this before `teardown` when your app is going to the background. + * Since the FIRMessaging connection won't be allowed to live when in background it is + * prudent to close the connection. + */ +- (void)disconnect; + +#pragma mark - Topics + +/** + * Asynchronously subscribes to a topic. + * + * @param topic The name of the topic, for example @"sports". + */ +- (void)subscribeToTopic:(nonnull NSString *)topic; + +/** + * Asynchronously unsubscribe to a topic. + * + * @param topic The name of the topic, for example @"sports". + */ +- (void)unsubscribeFromTopic:(nonnull NSString *)topic; + +#pragma mark - Upstream + +/** + * Sends an upstream ("device to cloud") message. + * + * The message will be queued if we don't have an active connection. + * You can only use the upstream feature if your GCM implementation + * uses the XMPP-based Cloud Connection Server. + * + * @param message Key/Value pairs to be sent. Values must be String, any + * other type will be ignored. + * @param to A string identifying the receiver of the message. For GCM + * project IDs the value is `SENDER_ID@gcm.googleapis.com`. + * @param messageID The ID of the message. This is generated by the application. It + * must be unique for each message generated by this application. + * It allows error callbacks and debugging, to uniquely identify + * each message. + * @param ttl The time to live for the message. In case we aren't able to + * send the message before the TTL expires we will send you a + * callback. If 0, we'll attempt to send immediately and return + * an error if we're not connected. Otherwise, the message will + * be queued. As for server-side messages, we don't return an error + * if the message has been dropped because of TTL; this can happen + * on the server side, and it would require extra communication. + */ +- (void)sendMessage:(nonnull NSDictionary *)message + to:(nonnull NSString *)receiver + withMessageID:(nonnull NSString *)messageID + timeToLive:(int64_t)ttl; + +#pragma mark - Analytics + +/** + * Call this when the app received a downstream message. Used to track message + * delivery and analytics for messages. You don't need to call this if you + * don't set the `FIRMessagingAutoSetupEnabled` flag in your Info.plist. In the + * latter case the library will call this implicitly to track relevant + * messages. + * + * @param message The downstream message received by the application. + * + * @return Information about the downstream message. + */ +- (nonnull FIRMessagingMessageInfo *)appDidReceiveMessage:(nonnull NSDictionary *)message; + +@end diff --git a/frameworks/FirebaseMessaging.framework/Headers/FirebaseMessaging.h b/frameworks/FirebaseMessaging.framework/Headers/FirebaseMessaging.h new file mode 100644 index 0000000000000000000000000000000000000000..ef49e7ff7a8354ca0e053a9fc930b51da96ac9d2 --- /dev/null +++ b/frameworks/FirebaseMessaging.framework/Headers/FirebaseMessaging.h @@ -0,0 +1 @@ +#import "FIRMessaging.h" diff --git a/frameworks/FirebaseMessaging.framework/Modules/module.modulemap b/frameworks/FirebaseMessaging.framework/Modules/module.modulemap new file mode 100644 index 0000000000000000000000000000000000000000..a390f119dae5dd8252d198c182ec8b0a42b987d0 --- /dev/null +++ b/frameworks/FirebaseMessaging.framework/Modules/module.modulemap @@ -0,0 +1,13 @@ +framework module FirebaseMessaging { + + export * + + umbrella header "FirebaseMessaging.h" + + header "FIRMessaging.h" + + link framework "AddressBook" + link framework "SystemConfiguration" + + link "sqlite3" +} diff --git a/frameworks/GoogleIPhoneUtilities.framework/GoogleIPhoneUtilities b/frameworks/GoogleIPhoneUtilities.framework/GoogleIPhoneUtilities new file mode 100644 index 0000000000000000000000000000000000000000..7ab2cf260ac516895154929b9df96bc4904867f8 Binary files /dev/null and b/frameworks/GoogleIPhoneUtilities.framework/GoogleIPhoneUtilities differ diff --git a/frameworks/GoogleInterchangeUtilities.framework/GoogleInterchangeUtilities b/frameworks/GoogleInterchangeUtilities.framework/GoogleInterchangeUtilities new file mode 100644 index 0000000000000000000000000000000000000000..dc653b3090663a62baa213c19832304af64e5787 Binary files /dev/null and b/frameworks/GoogleInterchangeUtilities.framework/GoogleInterchangeUtilities differ diff --git a/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities b/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities new file mode 100644 index 0000000000000000000000000000000000000000..016a5249e52f0c6028885df139d9c4b2a42c9a59 Binary files /dev/null and b/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities differ diff --git a/frameworks/GoogleUtilities.framework/GoogleUtilities b/frameworks/GoogleUtilities.framework/GoogleUtilities new file mode 100644 index 0000000000000000000000000000000000000000..31efbac443262bfd667b8d99b77f8ce6b52d998c Binary files /dev/null and b/frameworks/GoogleUtilities.framework/GoogleUtilities differ