Summary:
Added support for setting an optional badge icon number and alert action when using local notifications.
Closes https://github.com/facebook/react-native/pull/2931
Differential Revision: D3212448
Pulled By: mkonicek
fb-gh-sync-id: 063efcdd259b2a43f39812f57a71e8489ab33653
fbshipit-source-id: 063efcdd259b2a43f39812f57a71e8489ab33653
Summary:Follow-up to https://github.com/facebook/react-native/pull/5084
This…
- changes all requires within RN to `require('fbjs/lib/…')`
- updates `.flowconfig`
- updates `packager/blacklist.js`
- adapts tests
- removes things from `Libraries/vendor/{core,emitter}` that are also in fbjs
- removes knowledge of `fbjs` from the packager
Closes https://github.com/facebook/react-native/pull/5084
Reviewed By: bestander
Differential Revision: D2926835
fb-gh-sync-id: 2095e22b2f38e032599d1f2601722b3560e8b6e9
shipit-source-id: 2095e22b2f38e032599d1f2601722b3560e8b6e9
Summary:In order to use iOS notification actions with local notifications, we need to be able to specify a category string. This PR adds a category property to the `details` object used to create a local notification.
I also added support for the `alertAction` property, which is used to control the "slide to {alertAction}" text beneath the notification.
Finally, I added the doc for `userInfo` to `presentLocalNotification` (previously was only documented for `scheduleLocalNotification`.
**Test plan (required)**
I implemented the example from the [react-native-ios-notification-actions README](https://github.com/holmesal/react-native-ios-notification-actions), and created a couple of actions and grouped them under a category with identifier `something_happened`.
Prior to the changes in this PR, the shown local notification would not contain any actions.
With the changes in this PR, the shown local notification contains the specified actions.
Like so:
![demo](https://camo.githubusercontent.com/c4a86
Closes https://github.com/facebook/react-native/pull/5994
Differential Revision: D2953919
Pulled By: nicklockwood
fb-gh-sync-id: a05a9ea9ae8c150ff0714e106410e094c2747eca
shipit-source-id: a05a9ea9ae8c150ff0714e106410e094c2747eca
Summary:
This commit adds the delegate hooks so that local notifications get
passed onto the JS and adds a new event listener type for local
notifications.
Also add functions to clear local notifications
Closes https://github.com/facebook/react-native/pull/2084
Reviewed By: svcscm
Differential Revision: D2908096
Pulled By: nicklockwood
fb-gh-sync-id: 759d299ea35abea177e72934076297d666d3ea20
shipit-source-id: 759d299ea35abea177e72934076297d666d3ea20
Summary:
public
Map and Set are a standard JavaScript features, but are only supported in a subset of JSC versions that we target (e.g. iOS 7's JSC doesn't support Set).
The consequence of this is that failing to require('Set') before using it won't error during testing on a modern OS, but will fail on older OS versions. This diff makes the Map and Set polyfills available globally to all RN apps to avoid that problem.
Reviewed By: davidaurelio
Differential Revision: D2833997
fb-gh-sync-id: 713d8b69f6a1bce2472a1b2e6b84f69d75f30289
Summary:
Current version wasn't triggering any sound when a local notification was fired. I added the possibility to provide a custom sound and fallback to the default iOS sound if not provided.
Closes https://github.com/facebook/react-native/pull/4836
Reviewed By: svcscm
Differential Revision: D2807381
Pulled By: bestander
fb-gh-sync-id: c25e8f3c30a0714a5d9558c0c1fe344d0e93321e
Summary:
Including RCTPushNotificationManager is required for local notifications, which don't require a Push Notifications entitlement on your provisioning profile. However, if you don't have the entitlement, the app store warns you when you push an app build that contains `application:didRegisterForRemoteNotificationsWithDeviceToken:`, even if it isn't being called. This renames the methods so they have different names from the ones on UIApplication so the app store doesn't warn about them.
Closes https://github.com/facebook/react-native/pull/4897
Reviewed By: spicyj
Differential Revision: D2780533
Pulled By: nicklockwood
fb-gh-sync-id: 1a688f1ebd3cc9f86ba340ce453fdbfb46949839
Summary: I was just implementing push notifications for my iOS app and was very confused why the `register` event wasn't working.
[Eventually I ran across this tutorial](https://medium.com/@DannyvanderJagt/how-to-use-push-notifications-in-react-native-41e8b14aadae) that explained that I needed to update my AppDelegate to make that event work.
I've updated the documentation to include that note within the actual file.
Closes https://github.com/facebook/react-native/pull/3390
Reviewed By: @svcscm
Differential Revision: D2537853
Pulled By: @javache
fb-gh-sync-id: 1e8860173c38f6b2d7f9d273019f201e4cc9c0f2
Summary:
Add local notifications to the push library.
```
var PushNotificationIOS = React.PushNotificationIOS;
PushNotificationIOS.requestPermissions();
var notification = {
"fireDate": Date.now() + 10000,
"alertBody":"Whats up pumpkin"
};
PushNotificationIOS.scheduleLocalNotification(notification);
//lock screen or move away from app
```
Apple has another api for pushing immediately instead of scheduling, like when your background delegate has been called with some new data (bluetooth, location, etc)
```
var PushNotificationIOS = React.PushNotificationIOS;
PushNotificationIOS.requestPermissions();
var notification = {
"alertBody":"Whats up pumpkin"
};
PushNotificationIOS.presentLocalNotification(notification);
//lock screen or move away from app
```
Closed https://github.com/facebook/react-native/pull/843 looks related:
See https://developer.apple.com/library/ios/documentation/iPhone/Reference/UILocalNotification_Class/ for much more available in
Closes https://github.com/facebook/react-native/pull/1616
Github Author: Jacob Rosenthal <jakerosenthal@gmail.com>
Summary:
In order to add Push support to the Parse JS SDK in React Native, we need a way to receive the APNS device token from the JS context. This adds another event to PushNotificationIOS, so that code can respond to a successful registration.
Additionally, I've updated the `requestPermissions` call to accept an optional map of parameters. This way, developers can request a subset of user notification types.
Closes https://github.com/facebook/react-native/pull/1304
Github Author: Andrew Imm <andrewi@fb.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
- [ReactNative] Open Source PushNotifications and move Badge Number methods and permission into it | Tadeu Zagallo
- [react-packager] Fix regression with transform errors | Amjad Masad
- Flowify TextStylePropTypes and fix a bug with unsupported props | Marshall Roch
- [ReactNative] Remove `arc build` instructions from require | Alex Kotliarskyi
- Flowify Library/Utilities/ | Marshall Roch
- [react-packager] Default to index.js from main if it's a dir | Amjad Masad