feat(unvired-cordova-sdk): Add a new function to register and receive push notifications. (#3802)

* feat(unvired-cordova-sdk): support login via email

* fix(unvired-cordova-sdk): return typed promise object for user settings

* fix(unvired-cordova-sdk): change return type to string for guid()

* doc(unvired-cordova-sdk): doc update

* doc(unvired-cordova-sdk): update doc

* feat(unvired-cordova-sdk): add support for metadata JSON

* doc(unvired-cordova-sdk): update doc

* doc(unvired-cordova-sdk): update doc

* feat(unvired-cordova-sdk): add methods to get and set log level

* fix(unvired-cordova-sdk): update the return type for getLog()

* feat(unvired-cordova-sdk): return platform name

* feat(unvired-cordova-sdk): add method to get log file path

* feat(unvired-cordova-sdk): test push notifications

* fix(unvired-cordova-sdk): define return for logRead

* doc(unvired-cordova-sdk): remove mobile only restriction for some apis

* feat(unvired-cordova-sdk): add new property containing HTTP status code.

* feat(unvired-cordova-sdk): add new functions to lock & unlock sending of data

* fix(unvired-cordova-sdk): update the return type for lock and unlock functions.

* fix(unvired-cordova-sdk): change the return type for lockDataSender api

* fix(unvired-cordova-sdk): fix the data type for ResultType and OutboxLockStatus

* doc(unvired-cordova-sdk): Update doc

* doc(unvired-cordova-sdk): Update doc

* feat(unvired-cordova-sdk): Added new notification type

* feat(unvired-cordova-sdk): delete outbox item based on lid

* fix(unvired-cordova-sdk): Update doc

* doc(unvired-cordova-sdk): Update doc for userSettings()

* feat(unvired-cordova-sdk): add new discovery api

* fix(unvired-cordova-sdk): rename the property

* doc(unvired-cordova-sdk): Doc update

* fix(unvired-cordova-sdk): Update the return type for startDiscoveryService api

* doc(unvired-cordova-sdk): Rename the loginParameter languageCode to loginLanguage.

* changes after doing npm install

* feat(unvired-cordova-sdk): Add a new login parameter to send jwt options.

* feat(unvired-cordova-sdk): add new function to cache website data

* feat(unvired-cordova-sdk): new function to export the database for browser platform

* fix(unvired-cordova-sdk): fix method names

* feat(unvired-cordova-sdk): add new function 'setClientCredentials'

* doc(unvired-cordova-sdk): Update doc

* fix(unvired-cordova-sdk): Create a new Credential object and pass that as an input to the setClientCredentials() function.

* fix(unvired-cordova-sdk): Fix the typo in the function parameter.

* fix(unvired-cordova-sdk): Changed the type of port to string.

* feat(unvired-cordova-sdk): add methods to encrypt and decrypt the string.

* Delete package-lock.json

removed the package-locj.json from the PR

* Update package-lock.json

fix(unvired-cordova-sdk): Update package-lock.json corresponding to version 5.35.0

* doc(unvired-cordova-sdk) Updated document for the new function

Co-authored-by: Srinidhi Anand Rao <srinidhi.rao@unvired.io>
This commit is contained in:
Srinidhi 2021-10-08 12:13:24 +05:30 committed by GitHub
parent 02259e8873
commit 7a19f7d774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1635,4 +1635,32 @@ export class UnviredCordovaSDK extends AwesomeCordovaNativePlugin {
decrypt(stringToBeDecrypted: string): Promise<UnviredResult> {
return;
}
/**
* Supported in browser platform only.
* You can make use of this api in order to receive push notifications. No input required.
* Upon succesful registration you will get a |evtSource| object on which various events are received.
* Usage:
* ```
* this.unviredSDK.registerForPushNotification((evtSource) => {
* evtSource.onopen = function(event) {
* console.log(" onopen registerForPushNotification ==========")
* };
* evtSource.onerror = function(err) {
* console.log(" onerror registerForPushNotification ==========")
* };
* evtSource.onmessage = function(event) {
* console.log(" onmessage registerForPushNotification ==========")
* }
* },
* (error) => {
* console.log(" error registerForPushNotification ==========")
* console.log(error)
* });
* ```
*/
@Cordova()
registerForPushNotification(): Promise<any> {
return;
}
}