forked from fechanique/cordova-plugin-fcm
-
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build changed to simplify ionic/v4/FCM.js
Upgraded version to 7.0.3
- Loading branch information
1 parent
192f792
commit a54f002
Showing
15 changed files
with
87 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,63 @@ | ||
import { __decorate } from "tslib"; | ||
import { Injectable } from '@angular/core'; | ||
import { Plugin } from '@ionic-native/core'; | ||
import { Subject } from 'rxjs'; | ||
var FCM = (function () { | ||
function FCM() { | ||
import { __decorate } from 'tslib' | ||
import { Injectable } from '@angular/core' | ||
import { Plugin } from '@ionic-native/core' | ||
import { Subject } from 'rxjs' | ||
|
||
function FCM() {} | ||
FCM.prototype.clearAllNotifications = function () { | ||
return window.FCM.clearAllNotifications() | ||
} | ||
FCM.prototype.createNotificationChannel = function (channelConfig) { | ||
return window.FCM.createNotificationChannel(channelConfig) | ||
} | ||
FCM.prototype.getAPNSToken = function () { | ||
return window.FCM.getAPNSToken() | ||
} | ||
FCM.prototype.getInitialPushPayload = function () { | ||
return window.FCM.getInitialPushPayload() | ||
} | ||
FCM.prototype.getToken = function () { | ||
return window.FCM.getToken() | ||
} | ||
FCM.prototype.hasPermission = function () { | ||
return window.FCM.hasPermission() | ||
} | ||
FCM.prototype.onNotification = function (options) { | ||
var observable = new Subject() | ||
var handler = function (payload) { | ||
return observable.next(payload) | ||
} | ||
FCM.prototype.clearAllNotifications = function () { | ||
return window.FCM.clearAllNotifications(); | ||
}; | ||
FCM.prototype.createNotificationChannel = function (channelConfig) { | ||
return window.FCM.createNotificationChannel(channelConfig); | ||
}; | ||
FCM.prototype.getAPNSToken = function () { | ||
return window.FCM.getAPNSToken(); | ||
}; | ||
FCM.prototype.getInitialPushPayload = function () { | ||
return window.FCM.getInitialPushPayload(); | ||
}; | ||
FCM.prototype.getToken = function () { | ||
return window.FCM.getToken(); | ||
}; | ||
FCM.prototype.hasPermission = function () { | ||
return window.FCM.hasPermission(); | ||
}; | ||
FCM.prototype.onNotification = function (options) { | ||
var observable = new Subject(); | ||
var handler = function (payload) { return observable.next(payload); }; | ||
window.FCM.onNotification(handler, options); | ||
return observable; | ||
}; | ||
FCM.prototype.onTokenRefresh = function (options) { | ||
var observable = new Subject(); | ||
window.FCM.onTokenRefresh(function (token) { return observable.next(token); }, options); | ||
return observable; | ||
}; | ||
FCM.prototype.requestPushPermission = function (options) { | ||
return window.FCM.requestPushPermission(options); | ||
}; | ||
FCM.prototype.subscribeToTopic = function (topic) { | ||
return window.FCM.subscribeToTopic(topic); | ||
}; | ||
FCM.prototype.unsubscribeFromTopic = function (topic) { | ||
return window.FCM.unsubscribeFromTopic(topic); | ||
}; | ||
FCM = __decorate([ | ||
window.FCM.onNotification(handler, options) | ||
return observable | ||
} | ||
FCM.prototype.onTokenRefresh = function (options) { | ||
var observable = new Subject() | ||
window.FCM.onTokenRefresh(function (token) { | ||
return observable.next(token) | ||
}, options) | ||
return observable | ||
} | ||
FCM.prototype.requestPushPermission = function (options) { | ||
return window.FCM.requestPushPermission(options) | ||
} | ||
FCM.prototype.subscribeToTopic = function (topic) { | ||
return window.FCM.subscribeToTopic(topic) | ||
} | ||
FCM.prototype.unsubscribeFromTopic = function (topic) { | ||
return window.FCM.unsubscribeFromTopic(topic) | ||
} | ||
FCM = __decorate( | ||
[ | ||
Plugin({ | ||
pluginName: 'FCM', | ||
plugin: 'cordova-plugin-fcm-with-dependecy-updated', | ||
pluginRef: 'FCM', | ||
repo: 'https://github.com/andrehtissot/cordova-plugin-fcm-with-dependecy-updated', | ||
platforms: ['Android', 'iOS'], | ||
platforms: ['Android', 'iOS'] | ||
}), | ||
Injectable() | ||
], FCM); | ||
return FCM; | ||
}()); | ||
export { FCM }; | ||
], | ||
FCM | ||
) | ||
|
||
export { FCM } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## Build JS files | ||
tsc -p . --declaration false --removeComments true | ||
|
||
## Move files to the correct directories | ||
cd ../../ionic | ||
mv ionic/*.js . | ||
mv ionic/ngx/*.js ./ngx/ | ||
mv ionic/v4/*.js ./v4/ | ||
|
||
## Simplify v4 build | ||
sed 's/var FCM = (function () {//' v4/FCM.js > v4/FCM.js.tmp | ||
sed 's/}());//' v4/FCM.js.tmp > v4/FCM.js | ||
sed 's/return FCM;//' v4/FCM.js > v4/FCM.js.tmp | ||
mv v4/FCM.js.tmp v4/FCM.js | ||
npx prettier v4/FCM.js --write |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters