@awesome-cordova-plugins/onesignal 6.16.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -414,10 +414,9 @@ export interface OSInAppMessageAction {
414
414
  * OSActionType
415
415
  * OSInAppMessageAction
416
416
  */
417
- export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
417
+ export declare class OneSignal extends AwesomeCordovaNativePlugin {
418
418
  /**
419
419
  * constants to use in inFocusDisplaying()
420
- *
421
420
  * @hidden
422
421
  */
423
422
  OSInFocusDisplayOption: {
@@ -427,7 +426,6 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
427
426
  };
428
427
  /**
429
428
  * Start the initialization process. Once you are done configuring OneSignal, call the `endInit` function.
430
- *
431
429
  * @param {string} appId Your OneSignal app id
432
430
  * @param {string} googleProjectNumber **ANDROID** - your Google project number; only required for Android GCM/FCM pushes.
433
431
  * @returns {any}
@@ -435,7 +433,6 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
435
433
  startInit(appId: string, googleProjectNumber?: string): any;
436
434
  /**
437
435
  * Callback to run when a notification is received, whether it was displayed or not.
438
- *
439
436
  * @returns {Observable<OneSignalReceivedNotification>}
440
437
  */
441
438
  handleNotificationReceived(): Observable<OSNotification>;
@@ -443,19 +440,16 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
443
440
  * Callback to run when a notification is tapped on from the notification shade (**ANDROID**) or notification
444
441
  * center (**iOS**), or when closing an Alert notification shown in the app (if InAppAlert is enabled in
445
442
  * inFocusDisplaying).
446
- *
447
443
  * @returns {Observable<OneSignalOpenedNotification>}
448
444
  */
449
445
  handleNotificationOpened(): Observable<OSNotificationOpenedResult>;
450
446
  /**
451
447
  * Use to process an In-App Message the user just tapped on.
452
- *
453
448
  * @returns {Observable<OSInAppMessageAction>}
454
449
  */
455
450
  handleInAppMessageClicked(): Observable<OSInAppMessageAction>;
456
451
  /**
457
452
  * iOS** - Settings for iOS apps
458
- *
459
453
  * @param settings
460
454
  * kOSSettingsKeyAutoPrompt: boolean = true
461
455
  * Auto prompt user for notification permissions.
@@ -472,13 +466,11 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
472
466
  }): any;
473
467
  /**
474
468
  * Must be called after `startInit` to complete initialization of OneSignal.
475
- *
476
469
  * @returns {any}
477
470
  */
478
471
  endInit(): any;
479
472
  /**
480
473
  * Prompt the user for notification permissions. Callback fires as soon as the user accepts or declines notifications.
481
- *
482
474
  * @returns {Promise<boolean>}
483
475
  */
484
476
  promptForPushNotificationsWithUserResponse(): Promise<boolean>;
@@ -486,14 +478,12 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
486
478
  * Retrieve a list of tags that have been set on the user from the OneSignal server.
487
479
  *
488
480
  * Quirk**: You must wait for `getTags` to resolve before calling it again, as the plugin will only process the last method call and discard any previous ones.
489
- *
490
481
  * @returns {Promise<any>} Returns a Promise that resolves when tags are recieved.
491
482
  */
492
483
  getTags(): Promise<any>;
493
484
  /**
494
485
  * Lets you retrieve the OneSignal user id and device token.
495
486
  * Your handler is called after the device is successfully registered with OneSignal.
496
- *
497
487
  * @returns {Promise<Object>} Returns a Promise that resolves if the device was successfully registered.
498
488
  *
499
489
  * userId {string} OneSignal userId is a UUID formatted string. (unique per device per app)
@@ -507,7 +497,6 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
507
497
  /**
508
498
  * Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
509
499
  * Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
510
- *
511
500
  * @param {string} Key of your choosing to create or update.
512
501
  * @param {string} Value to set on the key. NOTE: Passing in a blank String deletes the key, you can also call deleteTag.
513
502
  * @param key
@@ -517,21 +506,18 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
517
506
  /**
518
507
  * Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
519
508
  * Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
520
- *
521
509
  * @param {string} Pass a json object with key/value pairs like: {key: "value", key2: "value2"}
522
510
  * @param json
523
511
  */
524
512
  sendTags(json: any): void;
525
513
  /**
526
514
  * Deletes a tag that was previously set on a user with `sendTag` or `sendTags`. Use `deleteTags` if you need to delete more than one.
527
- *
528
515
  * @param {string} Key to remove.
529
516
  * @param key
530
517
  */
531
518
  deleteTag(key: string): void;
532
519
  /**
533
520
  * Deletes tags that were previously set on a user with `sendTag` or `sendTags`.
534
- *
535
521
  * @param {string[]} Keys to remove.
536
522
  * @param keys
537
523
  */
@@ -547,7 +533,6 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
547
533
  *
548
534
  * By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode.
549
535
  * Passing false means that the device will only vibrate lightly when the device is in it's vibrate only mode.
550
- *
551
536
  * @param {boolean} false to disable vibrate, true to re-enable it.
552
537
  * @param enable
553
538
  */
@@ -558,15 +543,13 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
558
543
  *
559
544
  * By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
560
545
  * Passing false means that the device will only vibrate unless the device is set to a total silent mode.
561
- *
562
546
  * @param {boolean} false to disable sound, true to re-enable it.
563
547
  * @param enable
564
548
  */
565
549
  enableSound(enable: boolean): void;
566
550
  /**
567
551
  *
568
- * Setting to control how OneSignal notifications will be shown when one is received while your app is in focus. By default this is set to inAppAlert, which can be helpful during development.
569
- *
552
+ *Setting to control how OneSignal notifications will be shown when one is received while your app is in focus. By default this is set to inAppAlert, which can be helpful during development.
570
553
  * @param {DisplayType} displayOption
571
554
  * @returns {any}
572
555
  */
@@ -574,13 +557,11 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
574
557
  /**
575
558
  * You can call this method with false to opt users out of receiving all notifications through OneSignal.
576
559
  * You can pass true later to opt users back into notifications.
577
- *
578
560
  * @param {boolean} enable
579
561
  */
580
562
  setSubscription(enable: boolean): void;
581
563
  /**
582
564
  * Get the current notification and permission state. Returns a OSPermissionSubscriptionState type described below.
583
- *
584
565
  * @returns {Promise<OSPermissionSubscriptionState>}
585
566
  */
586
567
  getPermissionSubscriptionState(): Promise<OSPermissionSubscriptionState>;
@@ -593,7 +574,6 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
593
574
  postNotification(notificationObj: OSNotification): Promise<any>;
594
575
  /**
595
576
  * Cancels a single OneSignal notification based on its Android notification integer id. Use instead of NotificationManager.cancel(id); otherwise the notification will be restored when your app is restarted.
596
- *
597
577
  * @param notificationId {string}
598
578
  */
599
579
  cancelNotification(notificationId: string): void;
@@ -611,7 +591,6 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
611
591
  * The logging levels are as follows: 0 = None, 1= Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
612
592
  *
613
593
  * The higher the value the more information is shown.
614
- *
615
594
  * @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
616
595
  * @param logLevel
617
596
  * @param logLevel.logLevel
@@ -623,7 +602,6 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
623
602
  }): void;
624
603
  /**
625
604
  * Disable or enable location collection (Defaults to enabled) if your app has location permission.
626
- *
627
605
  * @param shared {boolean}
628
606
  */
629
607
  setLocationShared(shared: boolean): void;
@@ -633,7 +611,6 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
633
611
  * - Notification permission prompt shown
634
612
  * - The user accepting or declining the permission prompt
635
613
  * - Enabling/disabling notifications for your app in the device Settings after returning to your app.
636
- *
637
614
  * @returns {Observable<any>}
638
615
  */
639
616
  addPermissionObserver(): Observable<any>;
@@ -644,13 +621,11 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
644
621
  * - Getting a player / user id from OneSignal
645
622
  * - OneSignal.setSubscription is called
646
623
  * - User disables or enables notifications
647
- *
648
624
  * @returns {Observable<any>}
649
625
  */
650
626
  addSubscriptionObserver(): Observable<any>;
651
627
  /**
652
628
  * Clears all OneSignal notifications
653
- *
654
629
  * @param email
655
630
  * @param emailAuthToken
656
631
  */
@@ -666,7 +641,6 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
666
641
  * - Getting a player / user id from OneSignal
667
642
  * - OneSignal.setSubscription is called
668
643
  * - User disables or enables notifications
669
- *
670
644
  * @returns {Observable<any>}
671
645
  */
672
646
  addEmailSubscriptionObserver(): Observable<any>;
@@ -677,27 +651,23 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
677
651
  /**
678
652
  * Allows you to delay the initialization of the SDK until the user provides privacy consent.
679
653
  * The SDK will not be fully initialized until the provideUserConsent(true) method is called.
680
- *
681
654
  * @param {boolean} required
682
655
  */
683
656
  setRequiresUserPrivacyConsent(required: boolean): void;
684
657
  /**
685
658
  * If your application is set to require the user's privacy consent, you can provide this consent using this method.
686
659
  * Until you call provideUserConsent(true), the SDK will not fully initialize and will not send any data to OneSignal.
687
- *
688
660
  * @param {boolean} granted
689
661
  */
690
662
  provideUserConsent(granted: boolean): void;
691
663
  /**
692
664
  * Accepts a callback, which returns a boolean variable indicating if the user has given privacy consent yet.
693
- *
694
665
  * @param {Function} callback
695
666
  */
696
667
  userProvidedPrivacyConsent(callback: Function): void;
697
668
  /**
698
669
  * Allows you to use your own system's user ID's to send push notifications to your users.
699
670
  * To tie a user to a given user ID, you can use this method.
700
- *
701
671
  * @param {string} externalId
702
672
  */
703
673
  setExternalUserId(externalId: string): void;
@@ -707,32 +677,27 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
707
677
  removeExternalUserId(): void;
708
678
  /**
709
679
  * Add a trigger. May show an In-App Message if its trigger conditions were met.
710
- *
711
680
  * @param {string} key Key for the trigger.
712
681
  * @param {string | number | Object} value Value for the trigger. String or number recommended. Object passed in will be converted to a string.
713
682
  */
714
683
  addTrigger(key: string, value: string | number | Object): void;
715
684
  /**
716
685
  * Add a map of triggers. May show an In-App Message if its trigger conditions were met.
717
- *
718
686
  * @param {Object.<string, string | number | Object>} triggers Allows you to set multiple trigger key/value pairs simultaneously. Pass a json object with key/value pairs like: `{"key": "value", "key2": "value2"}`.
719
687
  */
720
688
  addTriggers(triggers: Object): void;
721
689
  /**
722
690
  * Removes a single trigger for the given key. May show an In-App Message if its trigger conditions were met.
723
- *
724
691
  * @param {string} key Key for trigger to remove.
725
692
  */
726
693
  removeTriggerForKey(key: string): void;
727
694
  /**
728
695
  * Removes a list of triggers based on a collection (array) of keys. May show an In-App Message if its trigger conditions were met.
729
- *
730
696
  * @param {string[]} keys Removes a collection of triggers from their keys. Pass an array of trigger keys like: `["key1", "key2", "key3"]`.
731
697
  */
732
698
  removeTriggersForKeys(keys: string[]): void;
733
699
  /**
734
700
  * Gets a trigger value for a provided trigger key.
735
- *
736
701
  * @param {string} key Key for trigger to get value.
737
702
  * @returns {Promise<string | number | Object>} Return value set with `addTrigger`, or `null`/`nil` (iOS) if never set or removed.
738
703
  */
@@ -740,10 +705,7 @@ export declare class OneSignalOriginal extends AwesomeCordovaNativePlugin {
740
705
  /**
741
706
  * Allows you to temporarily pause all In-App Messages. You may want to do this while the user is engaged in an activity that you don't want a message to interrupt (such as watching a video).
742
707
  * An In-App Message that would display if not paused will display right after resume if its conditions to display remains satisfied.
743
- *
744
708
  * @param {boolean} pause To pause, set `true`. To resume, set `false`.
745
709
  */
746
710
  pauseInAppMessages(pause: boolean): void;
747
711
  }
748
-
749
- export declare const OneSignal: OneSignalOriginal;