Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #js {:handler #object[NotificationsComponent [object Object]], :onRegister false, :onError false, :onNotification false, :onRemoteFetch false, :isLoaded true, :hasPoppedInitialNotification true, :isPermissionsRequestPending false, :permissions #js {:alert true, :badge true, :sound true}, :callNative #object[Function "function (name, params) {
- if (typeof this.handler[name] === 'function') {
- var _handler;
- if (typeof params !== 'array' && typeof params !== 'object') {
- params = [];
- }
- return (_handler = this.handler)[name].apply(_handler, babelHelpers.toConsumableArray(params));
- } else {
- return null;
- }
- }"], :configure #object[Function "function (options) {
- if (typeof options.onRegister !== 'undefined') {
- this.onRegister = options.onRegister;
- }
- if (typeof options.onError !== 'undefined') {
- this.onError = options.onError;
- }
- if (typeof options.onNotification !== 'undefined') {
- this.onNotification = options.onNotification;
- }
- if (typeof options.permissions !== 'undefined') {
- this.permissions = options.permissions;
- }
- if (typeof options.senderID !== 'undefined') {
- this.senderID = options.senderID;
- }
- if (typeof options.onRemoteFetch !== 'undefined') {
- this.onRemoteFetch = options.onRemoteFetch;
- }
- if (this.isLoaded === false) {
- this._onRegister = this._onRegister.bind(this);
- this._onNotification = this._onNotification.bind(this);
- this._onRemoteFetch = this._onRemoteFetch.bind(this);
- this.callNative('addEventListener', ['register', this._onRegister]);
- this.callNative('addEventListener', ['notification', this._onNotification]);
- this.callNative('addEventListener', ['localNotification', this._onNotification]);
- Platform.OS === 'android' ? this.callNative('addEventListener', ['remoteFetch', this._onRemoteFetch]) : null;
- this.isLoaded = true;
- }
- if (this.hasPoppedInitialNotification === false && (options.popInitialNotification === undefined || options.popInitialNotification === true)) {
- this.popInitialNotification(function (firstNotification) {
- if (firstNotification !== null) {
- this._onNotification(firstNotification, true);
- }
- }.bind(this));
- this.hasPoppedInitialNotification = true;
- }
- if (options.requestPermissions !== false) {
- this._requestPermissions();
- }
- }"], :unregister #object[Function "function () {
- this.callNative('removeEventListener', ['register', this._onRegister]);
- this.callNative('removeEventListener', ['notification', this._onNotification]);
- this.callNative('removeEventListener', ['localNotification', this._onNotification]);
- Platform.OS === 'android' ? this.callNative('removeEventListener', ['remoteFetch', this._onRemoteFetch]) : null;
- this.isLoaded = false;
- }"], :localNotification #object[Function "function (details) {
- if (Platform.OS === 'ios') {
- var soundName = details.soundName ? details.soundName : 'default';
- if (details.hasOwnProperty('playSound') && !details.playSound) {
- soundName = '';
- }
- this.handler.presentLocalNotification({
- alertTitle: details.title,
- alertBody: details.message,
- alertAction: details.alertAction,
- category: details.category,
- soundName: soundName,
- applicationIconBadgeNumber: details.number,
- userInfo: details.userInfo
- });
- } else {
- this.handler.presentLocalNotification(details);
- }
- }"], :localNotificationSchedule #object[Function "function (details) {
- if (Platform.OS === 'ios') {
- this.handler.scheduleLocalNotification({
- fireDate: details.date.toISOString(),
- alertBody: details.message,
- userInfo: details.userInfo
- });
- } else {
- details.fireDate = details.date.getTime();
- delete details.date;
- this.handler.scheduleLocalNotification(details);
- }
- }"], :_onRegister #object[bound "function () { [native code] }"], :_onRemoteFetch #object[bound "function () { [native code] }"], :_onNotification #object[bound "function () { [native code] }"], :_onPermissionResult #object[Function "function () {
- this.isPermissionsRequestPending = false;
- }"], :_requestPermissions #object[Function "function () {
- if (Platform.OS === 'ios') {
- if (this.isPermissionsRequestPending === false) {
- this.isPermissionsRequestPending = true;
- return this.callNative('requestPermissions', [this.permissions]).then(this._onPermissionResult.bind(this)).catch(this._onPermissionResult.bind(this));
- }
- } else if (typeof this.senderID !== 'undefined') {
- return this.callNative('requestPermissions', [this.senderID]);
- }
- }"], :requestPermissions #object[Function "function () {
- if (Platform.OS === 'ios') {
- return this.callNative('requestPermissions', [this.permissions]);
- } else if (typeof this.senderID !== 'undefined') {
- return this.callNative('requestPermissions', [this.senderID]);
- }
- }"], :presentLocalNotification #object[Function "function () {
- return this.callNative('presentLocalNotification', arguments);
- }"], :scheduleLocalNotification #object[Function "function () {
- return this.callNative('scheduleLocalNotification', arguments);
- }"], :cancelLocalNotifications #object[Function "function () {
- return this.callNative('cancelLocalNotifications', arguments);
- }"], :cancelAllLocalNotifications #object[Function "function () {
- return this.callNative('cancelAllLocalNotifications', arguments);
- }"], :setApplicationIconBadgeNumber #object[Function "function () {
- return this.callNative('setApplicationIconBadgeNumber', arguments);
- }"], :getApplicationIconBadgeNumber #object[Function "function () {
- return this.callNative('getApplicationIconBadgeNumber', arguments);
- }"], :popInitialNotification #object[Function "function (handler) {
- this.callNative('getInitialNotification').then(function (result) {
- handler(result);
- });
- }"], :abandonPermissions #object[Function "function () {
- return this.callNative('abandonPermissions', arguments);
- }"], :checkPermissions #object[Function "function () {
- return this.callNative('checkPermissions', arguments);
- }"], :registerNotificationActions #object[Function "function () {
- return this.callNative('registerNotificationActions', arguments);
- }"], :clearAllNotifications #object[Function "function () {
- return this.callNative('clearAllNotifications', arguments);
- }"]}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement