Commit Graph
35 Commits
Author SHA1 Message Date
Chen Liang 47d81fdf65 fix (#739) 2018-02-01 13:48:39 -08:00
Oleksiy Ivanov 799a808de6 [FCM] Add completion handler to subscribe/unsubscribe topic actions
Added functionality not exposed in public header yet. I would leave to next FCM SDK owner to expose this functionality (and follow any required review process).

Bugs:
72701086
2018-01-30 16:33:12 -08:00
Chen Liang fa81c48855 Merge branch 'master' into messaging-copy 2018-01-24 12:26:08 -08:00
chliangGoogle 4125066bb4 revert unrelated changes 2018-01-24 12:16:48 -08:00
chliangGoogle 74ea475810 revert unrelated changes 2018-01-24 12:15:30 -08:00
chliangGoogle a5efe7adeb revert unrelated changes 2018-01-24 12:12:16 -08:00
chliangGoogle 44a2bc0db0 Adding enable/disable property to FCM token auto Initialization 2018-01-24 11:57:27 -08:00
Paul Beusterien 8f0c325463 Update FirebaseMessaging protos (#696) 2018-01-24 10:38:32 -08:00
Paul Beusterien cc0ecd8aa4 Disable Messaging build warnings (#697) 2018-01-24 10:38:14 -08:00
Ryan Wilson 163eeeecb7 Revert changes introduced in #546 to fix build breakage. (#562) 2017-12-12 19:18:24 -05:00
Paul Beusterien 49a7ed7fc9 Fix FCM build warning introduced in Xcode 9 (#546) 2017-12-08 10:12:15 -08:00
Paul Beusterien ed3e4982f9 Standardize cross module imports with angle bracket syntax (#526)
Qualify all cross-pod imports of FirebaseCore headers
2017-12-04 08:52:11 -08:00
chliangGoogle 7b9a5601d7 FCM version should return only the sementic version and let IID handle the part adding prefix. 2017-11-30 17:16:31 -08:00
Paul Beusterien 343421d93e FIRAppInternal.h is a published private header (#501) 2017-11-28 13:52:51 -08:00
Ryan Wilson 7386f00178 Replacing FIR_SWIFT_NAME macro with NS_SWIFT_NAME. (#476)
* Replacing FIR_SWIFT_NAME macro with NS_SWIFT_NAME.

This pushes the minimum Xcode version to 7.3, as NS_SWIFT_NAME was
limited before that version (which is why the macro was introduced in
the first place).

* Fixed FIRMessaging header
2017-11-28 06:59:07 -08:00
Paul Beusterien b6339fa2c5 Remove unused code from Messaging (#458) 2017-11-15 10:01:05 -08:00
Riz 2b40693be4 Add simpler delegate method for FCM tokens (#375)
This new delegate method will be called generally once per app start, to always provide a current token. This token may change over time. This simpler method makes integration much simpler, as:

* Developers no longer have to check for a current token using the `.fcmToken` property, and also check for token changes using the `-messaging:didRefreshRegistrationToken:` delegate method.
* There is a single code path for when a token is available, making operations that depend on a token being available easier to implement. For example, this is the right method to always upload your FCM token to your application server, or to subscribe to topics, etc.
2017-10-12 16:09:07 -07:00
Paul Beusterien de481f78f0 Add void's to eliminate Xcode 9.1 warnings (#352) 2017-10-09 14:18:11 -07:00
Riz 5496eff88f Don't swizzle missing and optional delegate methods
FCM's swizzling of the user notification center currently swizzles only one of the two optional delegate methods (userNotificationCenter:willPresentNotification:withCompletionHandler:), but not the other (userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:).

The didReceiveNotificationResponse, if implemented by the delegate, is the sole receiver of all user action on a notification, including simply tapping on the notification itself. Prior to this change, if the developer had implemented didReceiveNotificationResponse, then FCM would not be able to collect this event for analytics.

Additionally, I changed the logic in FIRMessagingRemoteNotificationsProxy to check whether these methods are actually implemented before swizzling them. It was always swizzling, which meant it was adding an implementation if the method didn't exist. This would confuse iOS into thinking the developer did implement these methods and NOT fall back to delivering the notifications to the application delegate.

With this change, if the developer did not implement these methods, then FCM will not swizzle those methods. That keeps the behavior true to what the developer intended.
2017-10-04 18:39:30 -07:00
Riz b52f30c083 Clarify FCM SDK swizzling notice (#291)
The previous message was worded in a way as to imply that the FIRAppDelegateProxyEnabled key **should** be set to NO, disabling swizzling. This clarifies that message, indicating that this is for developers who would prefer to manually integrate the SDK.
2017-09-20 17:03:16 -07:00
Riz bc99b959e6 Fix app launch MCS connection issue (#290)
This fixes a bug in the automatic direct channel logic, where a failure to get checkin info from the Instance ID SDK was resulting in a non-retrying failure, causing the automatic connection logic to not retry connecting. A listener is added for a new notification that will be fired from Instance ID. When that notification is fired, `FIRMessagingClient` will re-attempt to connect.

NOTE: The actual fix will not work until the Firebase InstanceID SDK is also updated.
2017-09-19 15:08:35 -07:00
Riz 446c5c0267 Remove FIRMessaging_FAIL macro, log result code (#265)
This removes the `FIRMessaging_FAIL` macro which was using `__builtin_trap()`, and replaced with `NSAssert` calls. These `NSAssert` calls may not get called in release builds, and so we also log them with FIRLogger error messages.

The RMQ database open error result code is now parsed and included in the error message to help us identify causes for #199 .
2017-09-13 17:43:17 -07:00
Riz e00eaa8f0e Encode the topic name when subscribing (#220)
This should address the issue filed at: https://github.com/firebase/quickstart-ios/issues/242, where a topic name containing a `%` character was failing. It turns out that the topic name was never being url-encoded.
2017-08-30 15:38:43 -07:00
Riz 1a857fe48f Don't save library version to NSUserDefaults (#212)
This seems to be a holdover from some old code, and it's not being used anywhere in the component. Plus it's better not to be saving anything in `[NSUserDefaults standardUserDefaults]` as that is the developer/app's domain.

Also renamed the messaging code while I was in there to be something meaningful ("000" → "PrintLibraryVersion").
2017-08-23 13:52:42 -07:00
Riz 3e3aa42601 Ensure auto-connect logic is always in main thread (#183)
This addresses #125, where a developer is setting `.shouldEstablishDirectChannel` in a background thread, and getting a main thread sanitization issue in Xcode 9.
2017-08-07 15:05:21 -07:00
Riz 91fee9d66d Add comment about how multiple senders are supported (#158)
This is a slight tweak to the block comment describing `-retrieveFCMTokenForSenderID:completion:`, to more explicitly mention that this can be used to support the scenario of allow multiple senders to send notifications to the same client app.
2017-07-31 15:23:53 -07:00
Ryan Wilson 94dd3c50ad Configure Messaging for default FIRApp only. (#154)
Currently Messaging will use the most recent FIRApp configured which
isn't obvious. This will limit it to only the defualt FIRApp.
2017-07-26 22:17:48 -04:00
Paul Beusterien c33bdff405 Group public headers into Public directories (#112) 2017-06-29 12:03:45 -07:00
Paul Beusterien 0297375121 Rename FirebaseDev to FirebaseCommunity (#98) 2017-06-22 13:08:35 -07:00
Paul Beusterien e50dddc0f2 Fix Messaging doc (#97) 2017-06-21 10:13:02 -07:00
Riz bc4667ff58 Fix formatting inconsistencies in Messaging header (#61)
The header comments are directly reflected in Firebase documentation, so this improves that as well.
2017-06-02 14:03:17 -07:00
Paul Beusterien e58f734562 Add missing Foundation import (#46) 2017-05-31 17:34:57 -07:00
Riz 2c133b34b0 Clean up logging and configuration in Messaging (#28)
* Remove mostly unused code from FIRMessagingLogger

This cleans up some left-over old logging logic from before we moved to FIRLogger in Firebase Core. We no longer need this logging functionality.

* Delete FIRMessagingConfig.{h,m}

We no longer need a config class to store an unused log level filter (that filter is no longer needed).
2017-05-24 17:29:09 -07:00
Riz f67c074ed1 Log an error if for some reason we can't add a method to a class (#24)
Maybe it was already swizzled, or some other issue. Either way, it would be good to log this error, as it might help us / developers diagnose an issue.
2017-05-23 15:16:02 -07:00
Paul Beusterien 98ba64449a Initial 2017-05-15 12:27:07 -07:00