Commit Graph

1920 Commits

Author SHA1 Message Date
Chris Bianca afb511f968
Merge pull request #1235 from ifsnow/fix-notification-android-defaults
[Android] Fix setDefaults in Notifications.
2018-06-21 08:46:21 +01:00
ifsnow cbb35a0223 [Android] Fix setDefaults in Notifications. 2018-06-21 15:34:30 +09:00
Chris Bianca c4a11fa629 [config][types] Remove duplicate 2018-06-19 08:06:42 +01:00
Chris Bianca 3b3d013656 [config][types] Tweak types for remote config 2018-06-19 07:15:51 +01:00
Chris Bianca 90febd6f25
Merge pull request #1226 from Ken-Lim/master
Add type definition for RemoteConfig module
2018-06-19 07:13:37 +01:00
Ken Lim 1a1c91d5db Add type definition for RemoteConfig module 2018-06-19 12:08:30 +08:00
Chris Bianca d7d6124fc8
Merge pull request #1215 from ctaintor/add_instanceid_methods
adds support for getToken(string,string) and deleteToken()
2018-06-18 15:02:18 +01:00
Case Taintor 96783d46eb adds getToken(string,string) and deleteToken(string,string) to typings 2018-06-18 15:59:21 +02:00
Case Taintor 3652a05848 adds support for getToken(string,string) and deleteToken(string,string) to iid 2018-06-17 20:32:38 +02:00
Chris Bianca 88e232199b Merge branch 'master' of https://github.com/invertase/react-native-firebase 2018-06-17 16:36:12 +01:00
Chris Bianca 9e549d60b1 [firestore][typings] Add better type for DocumentChange.type #1180 2018-06-17 16:35:02 +01:00
Chris Bianca 69b2921ec2
Merge pull request #1164 from geriux/master
[Android] Support for areNotificationsEnabled
2018-06-17 16:27:03 +01:00
Chris Bianca a32cb27c43 [notifications][android] Rename variable 2018-06-17 16:19:55 +01:00
Chris Bianca fbc72dc2e3
Merge pull request #1221 from aMarCruz/drawable-resources
Adds support for drawable resources to AndroidNotification
2018-06-17 16:16:54 +01:00
Chris Bianca ab3557378e
Merge pull request #1220 from aMarCruz/importance-none
Closes #1213 : Incorrect definition of Android.Importance.None
2018-06-17 16:12:36 +01:00
Chris Bianca 00731cf10e Fix eslint error 2018-06-17 16:10:25 +01:00
Chris Bianca 8ee6e667e3
Merge pull request #1219 from aMarCruz/set-visibility
Closes #1216 : AndroidNotification.setVisibility does not exists
2018-06-17 16:09:01 +01:00
Chris Bianca cb05d63236 [auth] Update typings as per #1185 2018-06-17 16:07:23 +01:00
Chris Bianca 34545f1b6e
Merge pull request #1185 from sowdri/pr/phone-auth-listener-typings
Updated typings for PhoneAuthListener
2018-06-17 16:06:19 +01:00
Chris Bianca 3409e2d0c2 [android] Remove unnecessary rnpm post install step 2018-06-17 15:59:53 +01:00
Chris Bianca dae0645006 [android] Update to latest version of android libs; Fix compilation issues 2018-06-17 15:59:47 +01:00
aMarCruz b092ad1cd2 Adds support for drawable resources to AndroidNotification 2018-06-16 16:51:53 -05:00
aMarCruz c3c4c48ce1 Closes #1213 : Incorrect definition of Android.Importance.None 2018-06-16 15:20:18 -05:00
aMarCruz 962880518e Closes #1216 : firebase.notifications.AndroidNotification.setVisibility does not exists 2018-06-16 14:56:55 -05:00
Michael Diarmid bee7c7851f
Merge pull request #1195 from EvanBacon/@evanbacon/thread-deadlock-bug
Fixed Deadlock
2018-06-08 23:48:23 +01:00
Evan Bacon cca3c13d2d Fixed Deadlock
Running this in a detached expo app can sometimes deadlock from thread issues.
I've replaced `dispatch_sync(dispatch_get_main_queue(), ^{});`  with `RCTUnsafeExecuteOnMainQueueSync(^{});` to fix this.

I only hit the error in the `RNFirebaseStorage.m` but it seems like the `RNFirebaseAnalytics.m` and `RNFirebase.m` modules could also have this same issue.

`RCTUnsafeExecuteOnMainQueueSync` checks to see if the method is being executed on the main thread before trying to sync to the main thread. If you try to sync on the main thread whilst on the main thread, you hit a deadlock.

You can read more about it here: https://stackoverflow.com/questions/12379059/why-is-this-dispatch-sync-call-freezing?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

The only testing I did was in a seperate detached ExpoKit project. Running this function would cause the crash.
```js
await firebase
      .storage()
      .ref(uploadUri)
      .putFile(uri);
```
2018-06-08 14:44:48 -07:00
sowdri 5b3d9f97f7 Updated typings for PhoneAuthListener 2018-06-07 11:15:44 +09:30
Chris Bianca 2a083f7deb [android][notifications] Fix for #1167 - progress bar not working 2018-06-03 17:32:40 +04:00
Gerardo Pacheco d5e4808061 [android][messaging] Support for hasPermission using areNotificationsEnabled 2018-05-31 16:31:27 +02:00
Chris Bianca bc0326b3bf
Merge pull request #1113 from judemanutd/patch-2
Resolve display notification promise
2018-05-22 16:52:31 +01:00
Jude Fernandes 6e095be2bf
Resolve display notification promise
Once the notification is created the promise was not being resolved so in a situation where the user is waiting on the promise to complete, they would not get a callback and in case a user used async/await this would cause the app to get stuck at that point.
2018-05-22 01:20:52 +05:30
Chris Bianca 130321a27f 4.2.0 2018-05-18 08:54:42 +01:00
Chris Bianca 88b1cad8c4 [android][notifications] Change actions `runInBackground` to use `showUserInterface` instead 2018-05-18 08:26:16 +01:00
Chris Bianca 7b81731239 Update README.md versions 2018-05-18 08:01:40 +01:00
Chris Bianca 1f814d4cab [android][firestore] Ensure settings are preserved if `settings` is called multiple times 2018-05-18 07:58:32 +01:00
Michael Diarmid 4a362bd786
Update README.md 2018-05-17 09:57:56 +01:00
Michael Diarmid e8ed28de4c
Update README.md 2018-05-17 09:56:31 +01:00
Chris Bianca 92fa2f102a [ios][messaging] Clear pending messages once sent to JS 2018-05-17 08:27:23 +01:00
Chris Bianca dc793696fe [ios] Cache and then send data messages received whilst app is being initialised #1005 2018-05-16 17:37:58 +01:00
Chris Bianca 42e7fb2e5d [ios] Firebase iOS v5 support 2018-05-16 17:22:47 +01:00
Chris Bianca 34c0878098 [auth] Support email link in checkActionCode 2018-05-16 12:41:48 +01:00
Chris Bianca 35474462c6 [ios][firestore] Ensure that firestore uses the separate dispatch queue for callbacks 2018-05-16 12:11:55 +01:00
Chris Bianca 640d7aa7ae
Merge pull request #1074 from dluksza/android-notification-action-background-handler
Implement handling of Android actions in background
2018-05-16 10:39:18 +01:00
Dariusz Luksza 17f7f39dac Implement handling of Android actions in background
There are some cases when local notification action should be handled in
background eg. snoozing the reminder. In case of it launching app UI is
not necessary and would be confusing for the end user.

Therefore there should be a way to handle local notification action in
background.

For this reason new property 'runInBackground' was added to the
AndroidAction class and TypeScript type.

Also new broadcast receiver and service were implemented to handle
properly background actions.

In order to run particular action in background API consumer need to set its
'runInBackground' property to 'true', eg:

  ...
  .android.addAction(new firebase.notifications.Android.Action("snooze",
  "ic_snooze", "Snooze").setRunInBackground(true))
  ...

Then, there are two cases that API consumer needs to handle.

First when app is in the foreground, standard notification and
notification action code path will be executed. This mean, that:
 * onNotification() listener will be called (which should call
 displayNotification(), in order to show it to the user),
 * onNotificationOpen() listener will be called after the action is
 tapped by the user

Secondly, when application is in background or it is not running new
'RNFirebaseBackgroundNotificationAction' handler will be called. To
properly handle this case API consumer should create a background
asynchronous handler:

  const handleAsyncTask = async (notificationOpen: NotifficationOpen) => {
    if (notificationOpen && notificationOpen.notification) {
      const action = notificationOpen.action;
      const notificationId = notificationOpen.notification.notificationId;
      if (action === "snooze") {
        console.log("Reschedule notification for later time", notificationId);
      } else {
        console.log("unsupported action", action);
      }
      // hide the notification
      firebase.notifications().removeDeliveredNotification(notificationId);
    }
  }

Next hander should be registered to headless handler:

  AppRegistry.registerHeadlessTask('RNFirebaseBackgroundNotificationAction', () => handleAsyncTask);

Finally AndroidManifest.xml file must be modified, to include receiver
and service definition:

  <receiver
      android:name="io.invertase.firebase.notifications.RNFirebaseBackgroundNotificationActionReceiver"
      android:exported="true">
    <intent-filter>
      <action android:name="io.invertase.firebase.notifications.BackgroundAction"/>
    </intent-filter>
  </receiver>
  <service android:name="io.invertase.firebase.notifications.RNFirebaseBackgroundNotificationActionsService"/>

Now when ever 'Snooze' action is pressed it will launch
'handleAsyncTask' function in the background or onNotificationOpen()
when app is in foreground. And reschedule the notification
for the later time.
2018-05-16 08:20:24 +02:00
Chris Bianca fa9bac1a72 [ios] Set separate dispatch queues for firestore and database 2018-05-15 10:02:18 +01:00
Chris Bianca 54f41565db [misc] Update pods for tests and bridge 2018-05-15 10:01:52 +01:00
Michael Diarmid 7fb3e1464e
Merge pull request #1088 from pranjal-jain/fix-cancel-notification
[Android] [Notifications] Fix cancel notification promise
2018-05-15 00:23:26 +01:00
Pranjal Jain 4efb0c4dcf fix(notifications): Resolve promise on after notification is cancelled 2018-05-15 01:57:03 +05:30
Chris Bianca e68118e049
Merge pull request #1080 from dluksza/android-delete-channel
Add Android API to delete channel and channel group
2018-05-14 11:02:15 +01:00
Dariusz Luksza 57901cd29a Add Android API to delete channel and channel group 2018-05-14 09:24:44 +02:00