Commit Graph
57 Commits
Author SHA1 Message Date
Chen Liang 98549593ac fix a few place that copybara not properly handle the change (#2678) 2019-03-29 12:23:43 -07:00
Chen Liang e024df5073 fix typo in iOS target (#2673)
* also a few minor cleanup
2019-03-28 16:13:20 -07:00
Maksym Malyhin 04561fe74d FIRMessagingRemoteNotificationsProxy - test only public API with no assumptions on implementation (#2672) 2019-03-28 19:06:04 -04:00
Chen Liang 0091515b98 add image on notification support (#2644) 2019-03-26 20:15:34 -07:00
Chen Liang d87b15fa69 fix analyze warning in fcm (#2650) 2019-03-26 16:25:46 -07:00
Paul Beusterien 714bb34bc3 Revert #2491 (#2582) 2019-03-18 16:28:18 -07:00
Chen Liang 8061301cb9 File directory for tvOS should change from NSApplicationSupportDirector to NSCachesDirectory (#2496) 2019-03-13 08:57:47 -07:00
Chen Liang 681a5740b0 Add image on notification support (#2491)
This is official image notification support for FCM. Now an image can be rendered in notification when user enable service extension and calling the extensionHelper API.
2019-03-11 14:36:40 -07:00
Chen Liang 00168257df Make FCM and InstanceID compatible with tvOS (#2428) 2019-03-05 11:57:10 -08:00
Maksym Malyhin 8ffd9590cb FirebaseMessaging: NSUserDefaults replaced by GULUserDefaults (#2443)
* FirebaseMessaging: `NSUserDefaults` replaced by `GULUserDefaults`

* FirebaseMessaging: `GoogleUtilities/UserDefaults` added to dependencies. `GoogleUtilities` dependencies version updated to `~> 5.3`

* FIRMessagingPubSub: imports order
2019-02-26 15:31:18 -05:00
Ryan Wilson 1b777acdca Fix IID singleton usage. (#2446)
The singleton is cached and vended from the Core component system, we
shouldn't wrap it in a dispatch_async or cache it with a global variable.

This matches a change internally that has been made and shipped.
2019-02-26 12:26:42 -08:00
Paul Beusterien 82fd4b9fc6 Fix race causing occasional flake (#2427) 2019-02-22 14:36:29 -08:00
Paul Beusterien d232d1c30c Restore FIRInstanceIDWithFCMTest.m (#2417) 2019-02-21 20:16:45 -08:00
Paul Beusterien 6df99be073 Bump FirebaseAnalyticsInterop version (#2315) 2019-02-04 08:23:10 -08:00
Ryan Wilson 5982981e12 Prevent Messaging and IID singleton usage during tests. (#2250)
* Prevent Messaging and IID singleton usage during tests.

* Remove other uses of static Messaging instance.

* Removed usages of messagingForTests.

* Remove unused imports, unify testing code.

* Use local import path instead of framework import.
2019-01-28 18:05:16 -05:00
Chen Liang ab962ce244 use instanceIDForTest for instance init in unit tests (#2239)
* use instanceIDForTest for instance init in unit tests
* looks like realInstanceID is not needed
* Get InstanceID from SpecsStaging to fix tests
2019-01-10 10:49:43 -08:00
Chen Liang bc0329f48d fix the unit test #1451 (#2187) 2018-12-17 10:50:20 -08:00
Paul Beusterien c27db6d477 Fix analyze errors (#2047) 2018-11-05 13:07:22 -08:00
Paul Beusterien ea076e38a6 Don't rely on test always being in foreground (#2021) 2018-10-29 13:15:20 -07:00
Raman Yankouski 86be7764c9 Always use 24-hours locale (#1947)
* Always use 24-hours locale
* use en_US_POSIX instead of en_GB
* Update NSDateFormatter locale for messaging tests
2018-10-16 12:14:24 -07:00
Paul Beusterien 81fb6a03ef Remove need for [FIRApp configure] in Messaging unit tests (#1927)
* Remove need for [FIRApp configure] in Messaging unit tests
* Add missing file to test target
2018-10-10 15:24:04 -07:00
Paul Beusterien 467354a58f Do Messaging's Analytics logging via Interop (#1902) 2018-10-09 16:34:06 -07:00
Chen Liang 845a25e65b Fix the issue that when topic is invalid, the callback was not triggered. (#1880) 2018-09-28 10:27:05 -07:00
Chen Liang 4736e056ef Add a boolean value on whether to use direct channel callback for all ios versions (#1875) 2018-09-26 13:16:07 -07:00
Chen Liang be235ce752 remove unused method (#1682) 2018-08-13 15:04:59 -07:00
Ryan Wilson 1d484d33a7 Rename global data collection switch. (#1560) 2018-07-23 10:34:16 -07:00
Paul Beusterien 98b6eef71e Split GoogleUtilities from FirebaseCore (#1370) 2018-07-06 09:37:23 -07:00
Chen Liang 5e1472b492 Fix the race condition of global data flag and fcm auto init enabled flag (#1466) 2018-06-29 11:39:45 -07:00
Paul Beusterien 6eb22aa3a0 Disable failing didReceiveRemoteNotification tests(#1451) (#1452) 2018-06-25 17:16:20 -07:00
Chen Liang 468cb91517 add a warning message that the topic operation is suspended without a token (#1427) 2018-06-19 15:59:04 -07:00
Chen Liang 69ccd6d8b1 Corrected the deprecation warning when subscribing to or unsubscribing from a topic (#1425) 2018-06-19 14:08:53 -07:00
Ryan Wilson 08f447cd3f Add global data collection switch. (#1219)
* Addition of global data collection switch.
* Added Messaging conformance to data switch.
  Also formatted code.
* Move data collection flag internal until all SDKs conform to it.
* Formatting in response to code review.
2018-05-14 10:02:25 -07:00
Chen Liang 58b0aefc66 replace the private OCMock method with a public one, and also fix the EXC_BAD_ACCESSw (#1149) 2018-04-19 17:03:45 -07:00
Chen Liang 609cd0328a Options should be nullable for subscription (#1085)
Getting warning message from xcode so we need to define it to remove warning.
2018-04-13 11:15:28 -07:00
Paul Beusterien 42bc113754 Travis static library testing (#1047)
* Add Objective C example app for Messaging
* Travis static library testing
* static lib build fixes
2018-04-09 09:11:21 -07:00
Chen Liang 653aea7b50 Adding a new topic subscription/unsubcription with completion handler method (#1001)
* add new topic subscription/unsubscription method with handler
2018-03-30 11:41:38 -07:00
Ben Hamilton (Ben Gertzfield) cb1f65dfcf Migrate Firebase off ObjC module @import statements (#992)
* Migrate Firebase off @import statements

* - Migrate tests and test utils from @import to #import.
  - Update Xcode projects for tests to explicitly link in framework deps.
  - Update check_no_module_imports.sh to look for @imports in tests/test utils/
    integration tests.

* Ensure check_no_module_imports.sh explicitly exits with code 0 on success.
2018-03-29 08:44:48 -07:00
Morgan Chen c67031386d Remove FIRMessagingInstanceIDProxy 2018-03-27 12:37:27 -07:00
Chen Liang 976635fd87 avoid using initWithSuiteName which does not support iOS 7 (#765) 2018-02-06 18:13:54 -08:00
Oleksiy Ivanov 4e4c82b659 Fix tests. 2018-01-31 09:47:18 -08:00
Chen Liang 5306474396 adding unit test for auto init enable function (#710) 2018-01-25 13:44:22 -08:00
davidair a84704f65b Removing an obsolete setting from plist files (#617)
* Removing an obsolete setting from plist files

* Fixing Unit Tests

* Fixing nullability
2018-01-08 10:41:25 -05:00
Paul Beusterien da9308408d Use brackets for module imports (#487) 2017-11-22 09:19:10 -08:00
Paul Beusterien 3e592526ec Buildable and interoperable source pods (#444) 2017-11-21 17:02:22 -08:00
Paul Beusterien cfd8118355 Update messaging test for upcoming InstanceID changes (#425) 2017-11-03 12:28:03 -07: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
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
Paul Beusterien 3b6762135a Fix trailing space travis failure (#294) 2017-09-20 14:14:39 -07:00
Riz 637bf879ad Log incoming notifications to console as JSON (#286)
This will help debug incoming notifications.
2017-09-19 14:28:06 -07:00
Riz 66f3aeda16 Log direct-channel state changes to console (#287) 2017-09-19 12:58:58 -07:00