@aws-amplify/notifications 2.0.1-console-preview.5a31ca1.0 → 2.0.1-console-preview.8d88eef.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.
Files changed (603) hide show
  1. package/in-app-messaging/package.json +7 -0
  2. package/in-app-messaging/pinpoint/package.json +7 -0
  3. package/lib/{common/eventListeners/index.js → eventListeners/eventListeners.js} +0 -1
  4. package/lib/eventListeners/index.d.ts +2 -0
  5. package/lib/{common → eventListeners}/index.js +0 -3
  6. package/{lib-esm/common → lib}/eventListeners/types.d.ts +2 -2
  7. package/lib/{common/eventListeners → eventListeners}/types.js +0 -1
  8. package/lib/inAppMessaging/errors/InAppMessagingError.js +0 -1
  9. package/lib/inAppMessaging/errors/assertServiceError.js +0 -1
  10. package/lib/inAppMessaging/errors/assertValidationError.js +0 -1
  11. package/lib/inAppMessaging/errors/index.js +0 -1
  12. package/lib/inAppMessaging/errors/validation.d.ts +0 -1
  13. package/lib/inAppMessaging/errors/validation.js +0 -5
  14. package/lib/inAppMessaging/index.d.ts +1 -1
  15. package/lib/inAppMessaging/index.js +0 -1
  16. package/lib/inAppMessaging/providers/index.d.ts +2 -1
  17. package/lib/inAppMessaging/providers/index.js +11 -12
  18. package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +2 -3
  19. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -4
  20. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +6 -10
  21. package/lib/inAppMessaging/providers/pinpoint/apis/index.js +0 -1
  22. package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +4 -6
  23. package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +2 -3
  24. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +2 -3
  25. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +2 -3
  26. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +2 -3
  27. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +2 -3
  28. package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +0 -1
  29. package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js +6 -17
  30. package/lib/inAppMessaging/providers/pinpoint/index.d.ts +1 -0
  31. package/lib/inAppMessaging/providers/pinpoint/index.js +0 -1
  32. package/lib/inAppMessaging/providers/pinpoint/types/index.d.ts +2 -2
  33. package/lib/inAppMessaging/providers/pinpoint/types/index.js +0 -3
  34. package/lib/inAppMessaging/providers/pinpoint/types/inputs.js +0 -1
  35. package/lib/inAppMessaging/providers/pinpoint/types/options.js +0 -1
  36. package/lib/inAppMessaging/providers/pinpoint/types/outputs.d.ts +1 -1
  37. package/lib/inAppMessaging/providers/pinpoint/types/outputs.js +0 -1
  38. package/lib/inAppMessaging/providers/pinpoint/types/types.js +0 -1
  39. package/lib/inAppMessaging/providers/pinpoint/utils/constants.js +0 -1
  40. package/lib/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +1 -1
  41. package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js +2 -2
  42. package/lib/inAppMessaging/providers/pinpoint/utils/index.js +0 -1
  43. package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +1 -4
  44. package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +0 -1
  45. package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +0 -1
  46. package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js +0 -1
  47. package/lib/inAppMessaging/sessionTracker/SessionTracker.js +7 -7
  48. package/lib/inAppMessaging/sessionTracker/SessionTracker.native.js +2 -3
  49. package/lib/inAppMessaging/sessionTracker/index.js +0 -1
  50. package/lib/inAppMessaging/sessionTracker/types.js +0 -1
  51. package/lib/inAppMessaging/types/event.js +0 -1
  52. package/lib/inAppMessaging/types/index.d.ts +1 -2
  53. package/lib/inAppMessaging/types/index.js +0 -1
  54. package/lib/inAppMessaging/types/inputs.d.ts +1 -3
  55. package/lib/inAppMessaging/types/inputs.js +0 -1
  56. package/lib/inAppMessaging/types/message.js +0 -1
  57. package/lib/inAppMessaging/types/options.d.ts +1 -1
  58. package/lib/inAppMessaging/types/options.js +0 -1
  59. package/lib/inAppMessaging/utils/index.js +0 -1
  60. package/lib/inAppMessaging/utils/statusHelpers.js +0 -1
  61. package/lib/index.d.ts +0 -4
  62. package/lib/index.js +0 -7
  63. package/lib/pushNotifications/Platform/index.js +0 -1
  64. package/lib/pushNotifications/Platform/index.native.js +0 -1
  65. package/lib/pushNotifications/Platform/types.js +0 -1
  66. package/lib/pushNotifications/errors/PushNotificationError.d.ts +4 -0
  67. package/lib/pushNotifications/errors/PushNotificationError.js +19 -0
  68. package/lib/pushNotifications/errors/errorHelpers.d.ts +8 -0
  69. package/lib/pushNotifications/errors/errorHelpers.js +30 -0
  70. package/lib/pushNotifications/errors/index.d.ts +2 -0
  71. package/lib/pushNotifications/errors/index.js +9 -0
  72. package/lib/pushNotifications/index.d.ts +3 -2
  73. package/lib/pushNotifications/index.js +12 -3
  74. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.d.ts +14 -0
  75. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +20 -0
  76. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.d.ts +2 -0
  77. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +10 -0
  78. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.d.ts +18 -0
  79. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +24 -0
  80. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.d.ts +2 -0
  81. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +9 -0
  82. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.d.ts +27 -0
  83. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +33 -0
  84. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.d.ts +2 -0
  85. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +9 -0
  86. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.d.ts +53 -2
  87. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js +55 -5
  88. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.d.ts +2 -0
  89. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +38 -0
  90. package/lib/pushNotifications/providers/pinpoint/apis/index.d.ts +10 -0
  91. package/lib/pushNotifications/providers/pinpoint/apis/index.js +20 -1
  92. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.d.ts +17 -0
  93. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +23 -0
  94. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -0
  95. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +157 -0
  96. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.d.ts +27 -0
  97. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +33 -0
  98. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.d.ts +2 -0
  99. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +8 -0
  100. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.d.ts +43 -0
  101. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +49 -0
  102. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.d.ts +2 -0
  103. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +6 -0
  104. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.d.ts +27 -0
  105. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +33 -0
  106. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.d.ts +2 -0
  107. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +6 -0
  108. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.d.ts +28 -0
  109. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +34 -0
  110. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.d.ts +2 -0
  111. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +8 -0
  112. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.d.ts +32 -0
  113. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.js +38 -0
  114. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.d.ts +2 -0
  115. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +9 -0
  116. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.d.ts +14 -0
  117. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +20 -0
  118. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.d.ts +2 -0
  119. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +7 -0
  120. package/lib/pushNotifications/providers/pinpoint/index.d.ts +3 -1
  121. package/lib/pushNotifications/providers/pinpoint/index.js +10 -1
  122. package/lib/pushNotifications/providers/pinpoint/types/analytics.d.ts +6 -0
  123. package/lib/{common/AWSPinpointProviderCommon/types.js → pushNotifications/providers/pinpoint/types/analytics.js} +0 -1
  124. package/lib/pushNotifications/providers/pinpoint/types/apis.d.ts +13 -0
  125. package/lib/{types.js → pushNotifications/providers/pinpoint/types/apis.js} +0 -1
  126. package/lib/pushNotifications/providers/pinpoint/types/index.d.ts +6 -0
  127. package/lib/pushNotifications/providers/{index.js → pinpoint/types/index.js} +0 -3
  128. package/lib/pushNotifications/providers/pinpoint/types/inputs.d.ts +9 -0
  129. package/lib/pushNotifications/providers/pinpoint/types/inputs.js +4 -0
  130. package/lib/pushNotifications/providers/pinpoint/types/options.d.ts +5 -0
  131. package/lib/pushNotifications/providers/pinpoint/types/options.js +4 -0
  132. package/lib/pushNotifications/providers/pinpoint/types/outputs.d.ts +9 -0
  133. package/lib/pushNotifications/providers/pinpoint/types/outputs.js +4 -0
  134. package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +2 -0
  135. package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.js +4 -0
  136. package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +5 -0
  137. package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +60 -0
  138. package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +6 -0
  139. package/lib/pushNotifications/providers/{AWSPinpointProvider/utils.js → pinpoint/utils/getAnalyticsEvent.js} +8 -10
  140. package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +4 -0
  141. package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.js +23 -0
  142. package/lib/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.d.ts +2 -0
  143. package/lib/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js +11 -0
  144. package/lib/pushNotifications/providers/pinpoint/utils/index.d.ts +7 -0
  145. package/lib/pushNotifications/providers/pinpoint/utils/index.js +20 -0
  146. package/lib/pushNotifications/providers/pinpoint/utils/initializationManager.d.ts +12 -0
  147. package/lib/pushNotifications/providers/pinpoint/utils/initializationManager.js +23 -0
  148. package/lib/pushNotifications/providers/pinpoint/utils/resolveConfig.d.ts +7 -0
  149. package/lib/pushNotifications/providers/pinpoint/utils/resolveConfig.js +16 -0
  150. package/lib/pushNotifications/providers/pinpoint/utils/resolveCredentials.d.ts +7 -0
  151. package/lib/pushNotifications/providers/pinpoint/utils/resolveCredentials.js +22 -0
  152. package/lib/pushNotifications/providers/pinpoint/utils/tokenManager.d.ts +12 -0
  153. package/lib/pushNotifications/providers/pinpoint/utils/tokenManager.js +19 -0
  154. package/lib/pushNotifications/types/errors.d.ts +3 -0
  155. package/lib/pushNotifications/types/errors.js +8 -0
  156. package/lib/pushNotifications/types/index.d.ts +5 -0
  157. package/lib/pushNotifications/types/index.js +6 -0
  158. package/lib/pushNotifications/types/inputs.d.ts +23 -0
  159. package/lib/pushNotifications/types/inputs.js +4 -0
  160. package/lib/pushNotifications/types/options.d.ts +4 -0
  161. package/lib/pushNotifications/types/options.js +4 -0
  162. package/lib/pushNotifications/types/outputs.d.ts +10 -0
  163. package/lib/pushNotifications/types/outputs.js +4 -0
  164. package/lib/pushNotifications/types/pushNotifications.d.ts +5 -0
  165. package/lib/pushNotifications/types/pushNotifications.js +4 -0
  166. package/lib/tsconfig.build.tsbuildinfo +8684 -0
  167. package/lib-esm/{common/eventListeners/index.js → eventListeners/eventListeners.js} +0 -1
  168. package/lib-esm/eventListeners/index.d.ts +2 -0
  169. package/lib-esm/{common → eventListeners}/index.js +0 -2
  170. package/{lib/common → lib-esm}/eventListeners/types.d.ts +2 -2
  171. package/lib-esm/{common/AWSPinpointProviderCommon → eventListeners}/types.js +0 -1
  172. package/lib-esm/inAppMessaging/errors/InAppMessagingError.js +0 -1
  173. package/lib-esm/inAppMessaging/errors/assertServiceError.js +0 -1
  174. package/lib-esm/inAppMessaging/errors/assertValidationError.js +0 -1
  175. package/lib-esm/inAppMessaging/errors/index.js +0 -1
  176. package/lib-esm/inAppMessaging/errors/validation.d.ts +0 -1
  177. package/lib-esm/inAppMessaging/errors/validation.js +0 -5
  178. package/lib-esm/inAppMessaging/index.d.ts +1 -1
  179. package/lib-esm/inAppMessaging/index.js +0 -1
  180. package/lib-esm/inAppMessaging/providers/index.d.ts +2 -1
  181. package/lib-esm/inAppMessaging/providers/index.js +1 -2
  182. package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +1 -2
  183. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -4
  184. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +7 -11
  185. package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js +0 -1
  186. package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +1 -3
  187. package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +1 -2
  188. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +1 -2
  189. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +1 -2
  190. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +1 -2
  191. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +1 -2
  192. package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +0 -1
  193. package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js +8 -19
  194. package/lib-esm/inAppMessaging/providers/pinpoint/index.d.ts +1 -0
  195. package/lib-esm/inAppMessaging/providers/pinpoint/index.js +0 -1
  196. package/lib-esm/inAppMessaging/providers/pinpoint/types/index.d.ts +2 -2
  197. package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js +0 -2
  198. package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js +0 -1
  199. package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js +0 -1
  200. package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.d.ts +1 -1
  201. package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js +0 -1
  202. package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js +0 -1
  203. package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js +0 -1
  204. package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +1 -1
  205. package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js +2 -2
  206. package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js +0 -1
  207. package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +1 -4
  208. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +0 -1
  209. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +0 -1
  210. package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js +0 -1
  211. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.js +8 -8
  212. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.native.js +2 -3
  213. package/lib-esm/inAppMessaging/sessionTracker/index.js +0 -1
  214. package/lib-esm/inAppMessaging/sessionTracker/types.js +0 -1
  215. package/lib-esm/inAppMessaging/types/event.js +0 -1
  216. package/lib-esm/inAppMessaging/types/index.d.ts +1 -2
  217. package/lib-esm/inAppMessaging/types/index.js +0 -1
  218. package/lib-esm/inAppMessaging/types/inputs.d.ts +1 -3
  219. package/lib-esm/inAppMessaging/types/inputs.js +0 -1
  220. package/lib-esm/inAppMessaging/types/message.js +0 -1
  221. package/lib-esm/inAppMessaging/types/options.d.ts +1 -1
  222. package/lib-esm/inAppMessaging/types/options.js +0 -1
  223. package/lib-esm/inAppMessaging/utils/index.js +0 -1
  224. package/lib-esm/inAppMessaging/utils/statusHelpers.js +0 -1
  225. package/lib-esm/index.d.ts +0 -4
  226. package/lib-esm/index.js +0 -3
  227. package/lib-esm/pushNotifications/Platform/index.js +0 -1
  228. package/lib-esm/pushNotifications/Platform/index.native.js +0 -1
  229. package/lib-esm/pushNotifications/Platform/types.js +0 -1
  230. package/lib-esm/pushNotifications/errors/PushNotificationError.d.ts +4 -0
  231. package/lib-esm/pushNotifications/errors/PushNotificationError.js +17 -0
  232. package/lib-esm/pushNotifications/errors/errorHelpers.d.ts +8 -0
  233. package/lib-esm/pushNotifications/errors/errorHelpers.js +28 -0
  234. package/lib-esm/pushNotifications/errors/index.d.ts +2 -0
  235. package/lib-esm/pushNotifications/errors/index.js +4 -0
  236. package/lib-esm/pushNotifications/index.d.ts +3 -2
  237. package/lib-esm/pushNotifications/index.js +2 -3
  238. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.d.ts +14 -0
  239. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +18 -0
  240. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.d.ts +2 -0
  241. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +8 -0
  242. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.d.ts +18 -0
  243. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +22 -0
  244. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.d.ts +2 -0
  245. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +7 -0
  246. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.d.ts +27 -0
  247. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +31 -0
  248. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.d.ts +2 -0
  249. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +7 -0
  250. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.d.ts +53 -2
  251. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js +55 -4
  252. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.d.ts +2 -0
  253. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +36 -0
  254. package/lib-esm/pushNotifications/providers/pinpoint/apis/index.d.ts +10 -0
  255. package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js +10 -1
  256. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.d.ts +17 -0
  257. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +21 -0
  258. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -0
  259. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +155 -0
  260. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.d.ts +27 -0
  261. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +31 -0
  262. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.d.ts +2 -0
  263. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +6 -0
  264. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.d.ts +43 -0
  265. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +47 -0
  266. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.d.ts +2 -0
  267. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +4 -0
  268. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.d.ts +27 -0
  269. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +31 -0
  270. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.d.ts +2 -0
  271. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +4 -0
  272. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.d.ts +28 -0
  273. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +32 -0
  274. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.d.ts +2 -0
  275. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +6 -0
  276. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.d.ts +32 -0
  277. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.js +36 -0
  278. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.d.ts +2 -0
  279. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +7 -0
  280. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.d.ts +14 -0
  281. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +18 -0
  282. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.d.ts +2 -0
  283. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +5 -0
  284. package/lib-esm/pushNotifications/providers/pinpoint/index.d.ts +3 -1
  285. package/lib-esm/pushNotifications/providers/pinpoint/index.js +1 -2
  286. package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.d.ts +6 -0
  287. package/lib-esm/{common/eventListeners/types.js → pushNotifications/providers/pinpoint/types/analytics.js} +0 -1
  288. package/lib-esm/pushNotifications/providers/pinpoint/types/apis.d.ts +13 -0
  289. package/lib-esm/{types.js → pushNotifications/providers/pinpoint/types/apis.js} +0 -1
  290. package/lib-esm/pushNotifications/providers/pinpoint/types/index.d.ts +6 -0
  291. package/{src/pushNotifications/providers/index.ts → lib-esm/pushNotifications/providers/pinpoint/types/index.js} +0 -2
  292. package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.d.ts +9 -0
  293. package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.js +2 -0
  294. package/lib-esm/pushNotifications/providers/pinpoint/types/options.d.ts +5 -0
  295. package/lib-esm/pushNotifications/providers/pinpoint/types/options.js +2 -0
  296. package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.d.ts +9 -0
  297. package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.js +2 -0
  298. package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +2 -0
  299. package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.js +2 -0
  300. package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +5 -0
  301. package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +58 -0
  302. package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +6 -0
  303. package/lib-esm/pushNotifications/providers/{AWSPinpointProvider/utils.js → pinpoint/utils/getAnalyticsEvent.js} +8 -10
  304. package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +4 -0
  305. package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.js +21 -0
  306. package/lib-esm/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.d.ts +2 -0
  307. package/lib-esm/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js +9 -0
  308. package/lib-esm/pushNotifications/providers/pinpoint/utils/index.d.ts +7 -0
  309. package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js +9 -0
  310. package/lib-esm/pushNotifications/providers/pinpoint/utils/initializationManager.d.ts +12 -0
  311. package/lib-esm/pushNotifications/providers/pinpoint/utils/initializationManager.js +21 -0
  312. package/lib-esm/pushNotifications/providers/pinpoint/utils/resolveConfig.d.ts +7 -0
  313. package/lib-esm/pushNotifications/providers/pinpoint/utils/resolveConfig.js +14 -0
  314. package/lib-esm/pushNotifications/providers/pinpoint/utils/resolveCredentials.d.ts +7 -0
  315. package/lib-esm/pushNotifications/providers/pinpoint/utils/resolveCredentials.js +20 -0
  316. package/lib-esm/pushNotifications/providers/pinpoint/utils/tokenManager.d.ts +12 -0
  317. package/lib-esm/pushNotifications/providers/pinpoint/utils/tokenManager.js +17 -0
  318. package/lib-esm/pushNotifications/types/errors.d.ts +3 -0
  319. package/lib-esm/pushNotifications/types/errors.js +6 -0
  320. package/lib-esm/pushNotifications/types/index.d.ts +5 -0
  321. package/lib-esm/pushNotifications/types/index.js +3 -0
  322. package/lib-esm/pushNotifications/types/inputs.d.ts +23 -0
  323. package/lib-esm/pushNotifications/types/inputs.js +2 -0
  324. package/lib-esm/pushNotifications/types/options.d.ts +4 -0
  325. package/lib-esm/pushNotifications/types/options.js +2 -0
  326. package/lib-esm/pushNotifications/types/outputs.d.ts +10 -0
  327. package/lib-esm/pushNotifications/types/outputs.js +2 -0
  328. package/lib-esm/pushNotifications/types/pushNotifications.d.ts +5 -0
  329. package/lib-esm/pushNotifications/types/pushNotifications.js +2 -0
  330. package/lib-esm/tsconfig.build.tsbuildinfo +7085 -0
  331. package/package.json +15 -13
  332. package/push-notifications/package.json +7 -0
  333. package/push-notifications/pinpoint/package.json +7 -0
  334. package/src/{common → eventListeners}/index.ts +1 -6
  335. package/src/{common/eventListeners → eventListeners}/types.ts +2 -2
  336. package/src/inAppMessaging/errors/validation.ts +0 -4
  337. package/src/inAppMessaging/index.ts +12 -0
  338. package/src/inAppMessaging/providers/index.ts +24 -1
  339. package/src/inAppMessaging/providers/pinpoint/apis/dispatchEvent.ts +1 -1
  340. package/src/inAppMessaging/providers/pinpoint/apis/identifyUser.ts +7 -6
  341. package/src/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.ts +1 -2
  342. package/src/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.ts +1 -1
  343. package/src/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.ts +1 -1
  344. package/src/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.ts +1 -1
  345. package/src/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.ts +1 -1
  346. package/src/inAppMessaging/providers/pinpoint/apis/onMessageReceived.ts +1 -1
  347. package/src/inAppMessaging/providers/pinpoint/apis/syncMessages.ts +12 -29
  348. package/src/inAppMessaging/providers/pinpoint/index.ts +15 -0
  349. package/src/inAppMessaging/providers/pinpoint/types/index.ts +11 -1
  350. package/src/inAppMessaging/providers/pinpoint/types/outputs.ts +1 -1
  351. package/src/inAppMessaging/providers/pinpoint/utils/helpers.ts +1 -1
  352. package/src/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.ts +1 -3
  353. package/src/inAppMessaging/sessionTracker/SessionTracker.native.ts +2 -2
  354. package/src/inAppMessaging/sessionTracker/SessionTracker.ts +8 -10
  355. package/src/inAppMessaging/types/index.ts +3 -1
  356. package/src/inAppMessaging/types/inputs.ts +1 -3
  357. package/src/inAppMessaging/types/options.ts +1 -1
  358. package/src/index.ts +0 -9
  359. package/src/pushNotifications/errors/PushNotificationError.ts +18 -0
  360. package/src/pushNotifications/errors/errorHelpers.ts +40 -0
  361. package/src/pushNotifications/errors/index.ts +5 -0
  362. package/src/pushNotifications/index.ts +27 -5
  363. package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.ts +9 -0
  364. package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.ts +21 -0
  365. package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.ts +11 -0
  366. package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.ts +26 -0
  367. package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.ts +11 -0
  368. package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.ts +34 -0
  369. package/src/pushNotifications/providers/pinpoint/apis/identifyUser.native.ts +38 -0
  370. package/src/pushNotifications/providers/pinpoint/apis/identifyUser.ts +58 -7
  371. package/src/pushNotifications/providers/pinpoint/apis/index.ts +10 -0
  372. package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.ts +197 -0
  373. package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.ts +24 -0
  374. package/src/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.ts +8 -0
  375. package/src/pushNotifications/providers/pinpoint/apis/onNotificationOpened.ts +39 -0
  376. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.ts +8 -0
  377. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.ts +56 -0
  378. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.ts +8 -0
  379. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.ts +40 -0
  380. package/src/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.ts +8 -0
  381. package/src/pushNotifications/providers/pinpoint/apis/onTokenReceived.ts +39 -0
  382. package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.native.ts +11 -0
  383. package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.ts +39 -0
  384. package/src/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.ts +9 -0
  385. package/src/pushNotifications/providers/pinpoint/apis/setBadgeCount.ts +21 -0
  386. package/src/pushNotifications/providers/pinpoint/index.ts +30 -1
  387. package/src/pushNotifications/providers/pinpoint/types/analytics.ts +14 -0
  388. package/src/pushNotifications/providers/pinpoint/types/apis.ts +54 -0
  389. package/src/pushNotifications/providers/pinpoint/types/index.ts +40 -0
  390. package/src/pushNotifications/providers/pinpoint/types/inputs.ts +31 -0
  391. package/src/pushNotifications/providers/pinpoint/types/options.ts +9 -0
  392. package/src/pushNotifications/providers/pinpoint/types/outputs.ts +34 -0
  393. package/src/pushNotifications/providers/pinpoint/types/pushNotifications.ts +6 -0
  394. package/src/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.ts +66 -0
  395. package/src/pushNotifications/providers/{AWSPinpointProvider/utils.ts → pinpoint/utils/getAnalyticsEvent.ts} +19 -21
  396. package/src/pushNotifications/providers/pinpoint/utils/getChannelType.ts +25 -0
  397. package/src/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.ts +15 -0
  398. package/src/pushNotifications/providers/pinpoint/utils/index.ts +10 -0
  399. package/src/pushNotifications/providers/pinpoint/utils/initializationManager.ts +20 -0
  400. package/src/pushNotifications/providers/pinpoint/utils/resolveConfig.ts +16 -0
  401. package/src/pushNotifications/providers/pinpoint/utils/resolveCredentials.ts +14 -0
  402. package/src/pushNotifications/providers/pinpoint/utils/tokenManager.ts +20 -0
  403. package/src/pushNotifications/types/errors.ts +6 -0
  404. package/src/pushNotifications/types/index.ts +8 -0
  405. package/src/pushNotifications/types/inputs.ts +45 -0
  406. package/src/pushNotifications/types/options.ts +7 -0
  407. package/src/pushNotifications/types/outputs.ts +28 -0
  408. package/src/pushNotifications/types/pushNotifications.ts +22 -0
  409. package/lib/.tsbuildinfo +0 -3
  410. package/lib/common/AWSPinpointProviderCommon/index.d.ts +0 -39
  411. package/lib/common/AWSPinpointProviderCommon/index.js +0 -289
  412. package/lib/common/AWSPinpointProviderCommon/index.js.map +0 -1
  413. package/lib/common/AWSPinpointProviderCommon/types.d.ts +0 -10
  414. package/lib/common/AWSPinpointProviderCommon/types.js.map +0 -1
  415. package/lib/common/eventListeners/index.js.map +0 -1
  416. package/lib/common/eventListeners/types.js.map +0 -1
  417. package/lib/common/index.d.ts +0 -3
  418. package/lib/common/index.js.map +0 -1
  419. package/lib/inAppMessaging/errors/InAppMessagingError.js.map +0 -1
  420. package/lib/inAppMessaging/errors/assertServiceError.js.map +0 -1
  421. package/lib/inAppMessaging/errors/assertValidationError.js.map +0 -1
  422. package/lib/inAppMessaging/errors/index.js.map +0 -1
  423. package/lib/inAppMessaging/errors/validation.js.map +0 -1
  424. package/lib/inAppMessaging/index.js.map +0 -1
  425. package/lib/inAppMessaging/providers/index.js.map +0 -1
  426. package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js.map +0 -1
  427. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +0 -1
  428. package/lib/inAppMessaging/providers/pinpoint/apis/index.js.map +0 -1
  429. package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js.map +0 -1
  430. package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js.map +0 -1
  431. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js.map +0 -1
  432. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js.map +0 -1
  433. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js.map +0 -1
  434. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js.map +0 -1
  435. package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js.map +0 -1
  436. package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +0 -1
  437. package/lib/inAppMessaging/providers/pinpoint/index.js.map +0 -1
  438. package/lib/inAppMessaging/providers/pinpoint/types/errors.d.ts +0 -9
  439. package/lib/inAppMessaging/providers/pinpoint/types/errors.js +0 -15
  440. package/lib/inAppMessaging/providers/pinpoint/types/errors.js.map +0 -1
  441. package/lib/inAppMessaging/providers/pinpoint/types/index.js.map +0 -1
  442. package/lib/inAppMessaging/providers/pinpoint/types/inputs.js.map +0 -1
  443. package/lib/inAppMessaging/providers/pinpoint/types/options.js.map +0 -1
  444. package/lib/inAppMessaging/providers/pinpoint/types/outputs.js.map +0 -1
  445. package/lib/inAppMessaging/providers/pinpoint/types/types.js.map +0 -1
  446. package/lib/inAppMessaging/providers/pinpoint/utils/constants.js.map +0 -1
  447. package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js.map +0 -1
  448. package/lib/inAppMessaging/providers/pinpoint/utils/index.js.map +0 -1
  449. package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js.map +0 -1
  450. package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js.map +0 -1
  451. package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js.map +0 -1
  452. package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js.map +0 -1
  453. package/lib/inAppMessaging/sessionTracker/SessionTracker.js.map +0 -1
  454. package/lib/inAppMessaging/sessionTracker/SessionTracker.native.js.map +0 -1
  455. package/lib/inAppMessaging/sessionTracker/index.js.map +0 -1
  456. package/lib/inAppMessaging/sessionTracker/types.js.map +0 -1
  457. package/lib/inAppMessaging/types/config.d.ts +0 -5
  458. package/lib/inAppMessaging/types/config.js +0 -3
  459. package/lib/inAppMessaging/types/config.js.map +0 -1
  460. package/lib/inAppMessaging/types/event.js.map +0 -1
  461. package/lib/inAppMessaging/types/index.js.map +0 -1
  462. package/lib/inAppMessaging/types/inputs.js.map +0 -1
  463. package/lib/inAppMessaging/types/message.js.map +0 -1
  464. package/lib/inAppMessaging/types/options.js.map +0 -1
  465. package/lib/inAppMessaging/utils/index.js.map +0 -1
  466. package/lib/inAppMessaging/utils/statusHelpers.js.map +0 -1
  467. package/lib/index.js.map +0 -1
  468. package/lib/pushNotifications/NotEnabledError.d.ts +0 -3
  469. package/lib/pushNotifications/NotEnabledError.js +0 -16
  470. package/lib/pushNotifications/NotEnabledError.js.map +0 -1
  471. package/lib/pushNotifications/Platform/index.js.map +0 -1
  472. package/lib/pushNotifications/Platform/index.native.js.map +0 -1
  473. package/lib/pushNotifications/Platform/types.js.map +0 -1
  474. package/lib/pushNotifications/PlatformNotSupportedError.d.ts +0 -3
  475. package/lib/pushNotifications/PlatformNotSupportedError.js +0 -16
  476. package/lib/pushNotifications/PlatformNotSupportedError.js.map +0 -1
  477. package/lib/pushNotifications/index.js.map +0 -1
  478. package/lib/pushNotifications/providers/AWSPinpointProvider/index.d.ts +0 -15
  479. package/lib/pushNotifications/providers/AWSPinpointProvider/index.js +0 -65
  480. package/lib/pushNotifications/providers/AWSPinpointProvider/index.js.map +0 -1
  481. package/lib/pushNotifications/providers/AWSPinpointProvider/types.d.ts +0 -9
  482. package/lib/pushNotifications/providers/AWSPinpointProvider/types.js +0 -16
  483. package/lib/pushNotifications/providers/AWSPinpointProvider/types.js.map +0 -1
  484. package/lib/pushNotifications/providers/AWSPinpointProvider/utils.d.ts +0 -6
  485. package/lib/pushNotifications/providers/AWSPinpointProvider/utils.js.map +0 -1
  486. package/lib/pushNotifications/providers/index.d.ts +0 -1
  487. package/lib/pushNotifications/providers/index.js.map +0 -1
  488. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js.map +0 -1
  489. package/lib/pushNotifications/providers/pinpoint/apis/index.js.map +0 -1
  490. package/lib/pushNotifications/providers/pinpoint/index.js.map +0 -1
  491. package/lib/pushNotifications/types.d.ts +0 -71
  492. package/lib/pushNotifications/types.js +0 -12
  493. package/lib/pushNotifications/types.js.map +0 -1
  494. package/lib/pushNotifications/utils.d.ts +0 -3
  495. package/lib/pushNotifications/utils.js +0 -81
  496. package/lib/pushNotifications/utils.js.map +0 -1
  497. package/lib/types.d.ts +0 -39
  498. package/lib/types.js.map +0 -1
  499. package/lib-esm/.tsbuildinfo +0 -3
  500. package/lib-esm/common/AWSPinpointProviderCommon/index.d.ts +0 -39
  501. package/lib-esm/common/AWSPinpointProviderCommon/index.js +0 -287
  502. package/lib-esm/common/AWSPinpointProviderCommon/index.js.map +0 -1
  503. package/lib-esm/common/AWSPinpointProviderCommon/types.d.ts +0 -10
  504. package/lib-esm/common/AWSPinpointProviderCommon/types.js.map +0 -1
  505. package/lib-esm/common/eventListeners/index.js.map +0 -1
  506. package/lib-esm/common/eventListeners/types.js.map +0 -1
  507. package/lib-esm/common/index.d.ts +0 -3
  508. package/lib-esm/common/index.js.map +0 -1
  509. package/lib-esm/inAppMessaging/errors/InAppMessagingError.js.map +0 -1
  510. package/lib-esm/inAppMessaging/errors/assertServiceError.js.map +0 -1
  511. package/lib-esm/inAppMessaging/errors/assertValidationError.js.map +0 -1
  512. package/lib-esm/inAppMessaging/errors/index.js.map +0 -1
  513. package/lib-esm/inAppMessaging/errors/validation.js.map +0 -1
  514. package/lib-esm/inAppMessaging/index.js.map +0 -1
  515. package/lib-esm/inAppMessaging/providers/index.js.map +0 -1
  516. package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js.map +0 -1
  517. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +0 -1
  518. package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js.map +0 -1
  519. package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js.map +0 -1
  520. package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js.map +0 -1
  521. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js.map +0 -1
  522. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js.map +0 -1
  523. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js.map +0 -1
  524. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js.map +0 -1
  525. package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js.map +0 -1
  526. package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +0 -1
  527. package/lib-esm/inAppMessaging/providers/pinpoint/index.js.map +0 -1
  528. package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.d.ts +0 -9
  529. package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.js +0 -13
  530. package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.js.map +0 -1
  531. package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js.map +0 -1
  532. package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js.map +0 -1
  533. package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js.map +0 -1
  534. package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js.map +0 -1
  535. package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js.map +0 -1
  536. package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js.map +0 -1
  537. package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js.map +0 -1
  538. package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js.map +0 -1
  539. package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js.map +0 -1
  540. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js.map +0 -1
  541. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js.map +0 -1
  542. package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js.map +0 -1
  543. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.js.map +0 -1
  544. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.native.js.map +0 -1
  545. package/lib-esm/inAppMessaging/sessionTracker/index.js.map +0 -1
  546. package/lib-esm/inAppMessaging/sessionTracker/types.js.map +0 -1
  547. package/lib-esm/inAppMessaging/types/config.d.ts +0 -5
  548. package/lib-esm/inAppMessaging/types/config.js +0 -1
  549. package/lib-esm/inAppMessaging/types/config.js.map +0 -1
  550. package/lib-esm/inAppMessaging/types/event.js.map +0 -1
  551. package/lib-esm/inAppMessaging/types/index.js.map +0 -1
  552. package/lib-esm/inAppMessaging/types/inputs.js.map +0 -1
  553. package/lib-esm/inAppMessaging/types/message.js.map +0 -1
  554. package/lib-esm/inAppMessaging/types/options.js.map +0 -1
  555. package/lib-esm/inAppMessaging/utils/index.js.map +0 -1
  556. package/lib-esm/inAppMessaging/utils/statusHelpers.js.map +0 -1
  557. package/lib-esm/index.js.map +0 -1
  558. package/lib-esm/pushNotifications/NotEnabledError.d.ts +0 -3
  559. package/lib-esm/pushNotifications/NotEnabledError.js +0 -14
  560. package/lib-esm/pushNotifications/NotEnabledError.js.map +0 -1
  561. package/lib-esm/pushNotifications/Platform/index.js.map +0 -1
  562. package/lib-esm/pushNotifications/Platform/index.native.js.map +0 -1
  563. package/lib-esm/pushNotifications/Platform/types.js.map +0 -1
  564. package/lib-esm/pushNotifications/PlatformNotSupportedError.d.ts +0 -3
  565. package/lib-esm/pushNotifications/PlatformNotSupportedError.js +0 -14
  566. package/lib-esm/pushNotifications/PlatformNotSupportedError.js.map +0 -1
  567. package/lib-esm/pushNotifications/index.js.map +0 -1
  568. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/index.d.ts +0 -15
  569. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/index.js +0 -63
  570. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/index.js.map +0 -1
  571. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/types.d.ts +0 -9
  572. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/types.js +0 -14
  573. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/types.js.map +0 -1
  574. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/utils.d.ts +0 -6
  575. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/utils.js.map +0 -1
  576. package/lib-esm/pushNotifications/providers/index.d.ts +0 -1
  577. package/lib-esm/pushNotifications/providers/index.js +0 -4
  578. package/lib-esm/pushNotifications/providers/index.js.map +0 -1
  579. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js.map +0 -1
  580. package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js.map +0 -1
  581. package/lib-esm/pushNotifications/providers/pinpoint/index.js.map +0 -1
  582. package/lib-esm/pushNotifications/types.d.ts +0 -71
  583. package/lib-esm/pushNotifications/types.js +0 -10
  584. package/lib-esm/pushNotifications/types.js.map +0 -1
  585. package/lib-esm/pushNotifications/utils.d.ts +0 -3
  586. package/lib-esm/pushNotifications/utils.js +0 -79
  587. package/lib-esm/pushNotifications/utils.js.map +0 -1
  588. package/lib-esm/types.d.ts +0 -39
  589. package/lib-esm/types.js.map +0 -1
  590. package/src/common/AWSPinpointProviderCommon/index.ts +0 -300
  591. package/src/common/AWSPinpointProviderCommon/types.ts +0 -29
  592. package/src/inAppMessaging/providers/pinpoint/types/errors.ts +0 -12
  593. package/src/inAppMessaging/types/config.ts +0 -8
  594. package/src/pushNotifications/NotEnabledError.ts +0 -11
  595. package/src/pushNotifications/PlatformNotSupportedError.ts +0 -9
  596. package/src/pushNotifications/providers/AWSPinpointProvider/index.ts +0 -93
  597. package/src/pushNotifications/providers/AWSPinpointProvider/types.ts +0 -13
  598. package/src/pushNotifications/types.ts +0 -114
  599. package/src/pushNotifications/utils.ts +0 -112
  600. package/src/types.ts +0 -56
  601. /package/lib/{common/eventListeners/index.d.ts → eventListeners/eventListeners.d.ts} +0 -0
  602. /package/lib-esm/{common/eventListeners/index.d.ts → eventListeners/eventListeners.d.ts} +0 -0
  603. /package/src/{common/eventListeners/index.ts → eventListeners/eventListeners.ts} +0 -0
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var tslib_1 = require("tslib");
6
+ var utils_1 = require("@aws-amplify/core/internals/utils");
7
+ var pinpoint_1 = require("@aws-amplify/core/internals/providers/pinpoint");
8
+ var utils_2 = require("../utils");
9
+ exports.identifyUser = function (_a) {
10
+ var userId = _a.userId, userProfile = _a.userProfile, options = _a.options;
11
+ return tslib_1.__awaiter(void 0, void 0, void 0, function () {
12
+ var _b, credentials, identityId, _c, appId, region, _d, address, optOut, userAttributes;
13
+ return tslib_1.__generator(this, function (_e) {
14
+ switch (_e.label) {
15
+ case 0: return [4 /*yield*/, utils_2.resolveCredentials()];
16
+ case 1:
17
+ _b = _e.sent(), credentials = _b.credentials, identityId = _b.identityId;
18
+ _c = utils_2.resolveConfig(), appId = _c.appId, region = _c.region;
19
+ _d = options !== null && options !== void 0 ? options : {}, address = _d.address, optOut = _d.optOut, userAttributes = _d.userAttributes;
20
+ pinpoint_1.updateEndpoint({
21
+ address: address,
22
+ channelType: utils_2.getChannelType(),
23
+ optOut: optOut,
24
+ appId: appId,
25
+ category: 'PushNotification',
26
+ credentials: credentials,
27
+ identityId: identityId,
28
+ region: region,
29
+ userAttributes: userAttributes,
30
+ userId: userId,
31
+ userProfile: userProfile,
32
+ userAgentValue: utils_2.getPushNotificationUserAgentString(utils_1.PushNotificationAction.IdentifyUser),
33
+ });
34
+ return [2 /*return*/];
35
+ }
36
+ });
37
+ });
38
+ };
@@ -1 +1,11 @@
1
+ export { getBadgeCount } from './getBadgeCount';
2
+ export { getLaunchNotification } from './getLaunchNotification';
3
+ export { getPermissionStatus } from './getPermissionStatus';
1
4
  export { identifyUser } from './identifyUser';
5
+ export { initializePushNotifications } from './initializePushNotifications';
6
+ export { onNotificationOpened } from './onNotificationOpened';
7
+ export { onNotificationReceivedInBackground } from './onNotificationReceivedInBackground';
8
+ export { onNotificationReceivedInForeground } from './onNotificationReceivedInForeground';
9
+ export { onTokenReceived } from './onTokenReceived';
10
+ export { requestPermissions } from './requestPermissions';
11
+ export { setBadgeCount } from './setBadgeCount';
@@ -2,6 +2,25 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ var getBadgeCount_1 = require("./getBadgeCount");
6
+ exports.getBadgeCount = getBadgeCount_1.getBadgeCount;
7
+ var getLaunchNotification_1 = require("./getLaunchNotification");
8
+ exports.getLaunchNotification = getLaunchNotification_1.getLaunchNotification;
9
+ var getPermissionStatus_1 = require("./getPermissionStatus");
10
+ exports.getPermissionStatus = getPermissionStatus_1.getPermissionStatus;
5
11
  var identifyUser_1 = require("./identifyUser");
6
12
  exports.identifyUser = identifyUser_1.identifyUser;
7
- //# sourceMappingURL=index.js.map
13
+ var initializePushNotifications_1 = require("./initializePushNotifications");
14
+ exports.initializePushNotifications = initializePushNotifications_1.initializePushNotifications;
15
+ var onNotificationOpened_1 = require("./onNotificationOpened");
16
+ exports.onNotificationOpened = onNotificationOpened_1.onNotificationOpened;
17
+ var onNotificationReceivedInBackground_1 = require("./onNotificationReceivedInBackground");
18
+ exports.onNotificationReceivedInBackground = onNotificationReceivedInBackground_1.onNotificationReceivedInBackground;
19
+ var onNotificationReceivedInForeground_1 = require("./onNotificationReceivedInForeground");
20
+ exports.onNotificationReceivedInForeground = onNotificationReceivedInForeground_1.onNotificationReceivedInForeground;
21
+ var onTokenReceived_1 = require("./onTokenReceived");
22
+ exports.onTokenReceived = onTokenReceived_1.onTokenReceived;
23
+ var requestPermissions_1 = require("./requestPermissions");
24
+ exports.requestPermissions = requestPermissions_1.requestPermissions;
25
+ var setBadgeCount_1 = require("./setBadgeCount");
26
+ exports.setBadgeCount = setBadgeCount_1.setBadgeCount;
@@ -0,0 +1,17 @@
1
+ import { InitializePushNotifications } from '../types';
2
+ /**
3
+ * Initialize and set up the push notification category. The category must be first initialized before all other
4
+ * functionalities become available.
5
+ *
6
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
7
+ * only React Native is supported by this API.
8
+ * @remarks
9
+ * It is recommended that this be called as early in your app as possible at the root of your application to allow
10
+ * background processing of notifications.
11
+ * @example
12
+ * ```ts
13
+ * Amplify.configure(config);
14
+ * initializePushNotifications();
15
+ * ```
16
+ */
17
+ export declare const initializePushNotifications: InitializePushNotifications;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var utils_1 = require("@aws-amplify/core/internals/utils");
6
+ /**
7
+ * Initialize and set up the push notification category. The category must be first initialized before all other
8
+ * functionalities become available.
9
+ *
10
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
11
+ * only React Native is supported by this API.
12
+ * @remarks
13
+ * It is recommended that this be called as early in your app as possible at the root of your application to allow
14
+ * background processing of notifications.
15
+ * @example
16
+ * ```ts
17
+ * Amplify.configure(config);
18
+ * initializePushNotifications();
19
+ * ```
20
+ */
21
+ exports.initializePushNotifications = function () {
22
+ throw new utils_1.PlatformNotSupportedError();
23
+ };
@@ -0,0 +1 @@
1
+ export declare const initializePushNotifications: () => Promise<void>;
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var tslib_1 = require("tslib");
6
+ var core_1 = require("@aws-amplify/core");
7
+ var utils_1 = require("@aws-amplify/core/internals/utils");
8
+ var pinpoint_1 = require("@aws-amplify/core/internals/providers/pinpoint");
9
+ var react_native_1 = require("@aws-amplify/react-native");
10
+ var eventListeners_1 = require("../../../../eventListeners");
11
+ var utils_2 = require("../utils");
12
+ var _a = react_native_1.loadAmplifyPushNotification(), addMessageEventListener = _a.addMessageEventListener, addTokenEventListener = _a.addTokenEventListener, completeNotification = _a.completeNotification, getConstants = _a.getConstants, registerHeadlessTask = _a.registerHeadlessTask;
13
+ var logger = new core_1.ConsoleLogger('Notifications.PushNotification');
14
+ var BACKGROUND_TASK_TIMEOUT = 25; // seconds
15
+ exports.initializePushNotifications = function () {
16
+ if (utils_2.isInitialized()) {
17
+ logger.info('Push notifications have already been enabled');
18
+ return;
19
+ }
20
+ addNativeListeners();
21
+ addAnalyticsListeners();
22
+ utils_2.initialize();
23
+ };
24
+ var addAnalyticsListeners = function () {
25
+ var launchNotificationOpenedListenerRemover;
26
+ // wire up default Pinpoint message event handling
27
+ eventListeners_1.addEventListener('backgroundMessageReceived', utils_2.createMessageEventRecorder('backgroundMessageReceived'));
28
+ eventListeners_1.addEventListener('foregroundMessageReceived', utils_2.createMessageEventRecorder('foregroundMessageReceived'));
29
+ launchNotificationOpenedListenerRemover = eventListeners_1.addEventListener('launchNotificationsOpened', utils_2.createMessageEventRecorder('notificationOpened',
30
+ // once we are done with it we can remove the listener
31
+ launchNotificationOpenedListenerRemover === null ||
32
+ // once we are done with it we can remove the listener
33
+ launchNotificationOpenedListenerRemover === void 0 ? void 0 :
34
+ // once we are done with it we can remove the listener
35
+ launchNotificationOpenedListenerRemover.remove));
36
+ eventListeners_1.addEventListener('notificationOpened', utils_2.createMessageEventRecorder('notificationOpened',
37
+ // if we are in this state, we no longer need the listener as the app was launched via some other means
38
+ launchNotificationOpenedListenerRemover === null ||
39
+ // if we are in this state, we no longer need the listener as the app was launched via some other means
40
+ launchNotificationOpenedListenerRemover === void 0 ? void 0 :
41
+ // if we are in this state, we no longer need the listener as the app was launched via some other means
42
+ launchNotificationOpenedListenerRemover.remove));
43
+ };
44
+ var addNativeListeners = function () {
45
+ var _a = getConstants(), NativeEvent = _a.NativeEvent, NativeHeadlessTaskKey = _a.NativeHeadlessTaskKey;
46
+ var BACKGROUND_MESSAGE_RECEIVED = NativeEvent.BACKGROUND_MESSAGE_RECEIVED, FOREGROUND_MESSAGE_RECEIVED = NativeEvent.FOREGROUND_MESSAGE_RECEIVED, LAUNCH_NOTIFICATION_OPENED = NativeEvent.LAUNCH_NOTIFICATION_OPENED, NOTIFICATION_OPENED = NativeEvent.NOTIFICATION_OPENED, TOKEN_RECEIVED = NativeEvent.TOKEN_RECEIVED;
47
+ // on platforms that can handle headless tasks, register one to broadcast background message received to
48
+ // library listeners
49
+ if (NativeHeadlessTaskKey) {
50
+ registerHeadlessTask(function (message) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
51
+ return tslib_1.__generator(this, function (_a) {
52
+ switch (_a.label) {
53
+ case 0:
54
+ // keep headless task running until handlers have completed their work
55
+ return [4 /*yield*/, eventListeners_1.notifyEventListenersAndAwaitHandlers('backgroundMessageReceived', message)];
56
+ case 1:
57
+ // keep headless task running until handlers have completed their work
58
+ _a.sent();
59
+ return [2 /*return*/];
60
+ }
61
+ });
62
+ }); });
63
+ }
64
+ else if (BACKGROUND_MESSAGE_RECEIVED) {
65
+ // on platforms that can't handle headless tasks, listen for native background message received event and
66
+ // broadcast to library listeners
67
+ addMessageEventListener(BACKGROUND_MESSAGE_RECEIVED, function (message, completionHandlerId) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
68
+ var err_1;
69
+ return tslib_1.__generator(this, function (_a) {
70
+ switch (_a.label) {
71
+ case 0:
72
+ _a.trys.push([0, 2, 3, 4]);
73
+ return [4 /*yield*/, Promise.race([
74
+ eventListeners_1.notifyEventListenersAndAwaitHandlers('backgroundMessageReceived', message),
75
+ // background tasks will get suspended and all future tasks be deprioritized by the OS if they run for
76
+ // more than 30 seconds so we reject with a error in a shorter amount of time to prevent this from
77
+ // happening
78
+ new Promise(function (_, reject) {
79
+ setTimeout(function () {
80
+ return reject("onNotificationReceivedInBackground handlers should complete their work within " + BACKGROUND_TASK_TIMEOUT + " seconds, but they did not.");
81
+ }, BACKGROUND_TASK_TIMEOUT * 1000);
82
+ }),
83
+ ])];
84
+ case 1:
85
+ _a.sent();
86
+ return [3 /*break*/, 4];
87
+ case 2:
88
+ err_1 = _a.sent();
89
+ logger.error(err_1);
90
+ return [3 /*break*/, 4];
91
+ case 3:
92
+ // notify native module that handlers have completed their work (or timed out)
93
+ completeNotification(completionHandlerId);
94
+ return [7 /*endfinally*/];
95
+ case 4: return [2 /*return*/];
96
+ }
97
+ });
98
+ }); });
99
+ }
100
+ addMessageEventListener(
101
+ // listen for native foreground message received event and broadcast to library listeners
102
+ FOREGROUND_MESSAGE_RECEIVED, function (message) {
103
+ eventListeners_1.notifyEventListeners('foregroundMessageReceived', message);
104
+ });
105
+ var launchNotificationOpenedListener = LAUNCH_NOTIFICATION_OPENED
106
+ ? addMessageEventListener(
107
+ // listen for native notification opened app (user tapped on notification, opening the app from quit -
108
+ // not background - state) event. This is broadcasted to an internal listener only as it is not intended
109
+ // for use otherwise as it produces inconsistent results when used within React Native app context
110
+ LAUNCH_NOTIFICATION_OPENED, function (message) {
111
+ eventListeners_1.notifyEventListeners('launchNotificationsOpened', message);
112
+ // once we are done with it we can remove the listener
113
+ launchNotificationOpenedListener === null || launchNotificationOpenedListener === void 0 ? void 0 : launchNotificationOpenedListener.remove();
114
+ })
115
+ : null;
116
+ addMessageEventListener(
117
+ // listen for native notification opened (user tapped on notification, opening the app from background -
118
+ // not quit - state) event and broadcast to library listeners
119
+ NOTIFICATION_OPENED, function (message) {
120
+ eventListeners_1.notifyEventListeners('notificationOpened', message);
121
+ // if we are in this state, we no longer need the listener as the app was launched via some other means
122
+ launchNotificationOpenedListener === null || launchNotificationOpenedListener === void 0 ? void 0 : launchNotificationOpenedListener.remove();
123
+ });
124
+ addTokenEventListener(
125
+ // listen for native new token event, automatically re-register device with provider using new token and
126
+ // broadcast to library listeners
127
+ TOKEN_RECEIVED, function (token) {
128
+ // avoid a race condition where two endpoints are created with the same token on a fresh install
129
+ if (utils_2.getToken() === token) {
130
+ return;
131
+ }
132
+ utils_2.setToken(token);
133
+ registerDevice();
134
+ eventListeners_1.notifyEventListeners('tokenReceived', token);
135
+ });
136
+ };
137
+ var registerDevice = function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
138
+ var _a, credentials, identityId, _b, appId, region;
139
+ return tslib_1.__generator(this, function (_c) {
140
+ switch (_c.label) {
141
+ case 0: return [4 /*yield*/, utils_2.resolveCredentials()];
142
+ case 1:
143
+ _a = _c.sent(), credentials = _a.credentials, identityId = _a.identityId;
144
+ _b = utils_2.resolveConfig(), appId = _b.appId, region = _b.region;
145
+ return [2 /*return*/, pinpoint_1.updateEndpoint({
146
+ address: utils_2.getToken(),
147
+ appId: appId,
148
+ category: 'PushNotification',
149
+ credentials: credentials,
150
+ region: region,
151
+ channelType: utils_2.getChannelType(),
152
+ identityId: identityId,
153
+ userAgentValue: utils_2.getPushNotificationUserAgentString(utils_1.PushNotificationAction.InitializePushNotifications),
154
+ })];
155
+ }
156
+ });
157
+ }); };
@@ -0,0 +1,27 @@
1
+ import { OnNotificationOpened } from '../types';
2
+ /**
3
+ * Registers a listener that will be triggered when a notification is opened by user.
4
+ *
5
+ * @param {OnNotificationOpenedInput} input - A callback handler to be invoked with the opened
6
+ * {@link PushNotificationMessage}.
7
+ * @returns {OnNotificationOpenedOutput} - An object with a remove function to remove the listener.
8
+ * @example
9
+ * ```ts
10
+ * // Register a listener
11
+ * onNotificationOpened(message => {
12
+ * doSomething(message);
13
+ * });
14
+ * ```
15
+ * @example
16
+ * ```ts
17
+ * // Register multiple listeners
18
+ * onNotificationOpened(message => {
19
+ * doSomething(message);
20
+ * });
21
+ *
22
+ * onNotificationOpened(message => {
23
+ * doSomethingElse(message);
24
+ * });
25
+ * ```
26
+ */
27
+ export declare const onNotificationOpened: OnNotificationOpened;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var utils_1 = require("@aws-amplify/core/internals/utils");
6
+ /**
7
+ * Registers a listener that will be triggered when a notification is opened by user.
8
+ *
9
+ * @param {OnNotificationOpenedInput} input - A callback handler to be invoked with the opened
10
+ * {@link PushNotificationMessage}.
11
+ * @returns {OnNotificationOpenedOutput} - An object with a remove function to remove the listener.
12
+ * @example
13
+ * ```ts
14
+ * // Register a listener
15
+ * onNotificationOpened(message => {
16
+ * doSomething(message);
17
+ * });
18
+ * ```
19
+ * @example
20
+ * ```ts
21
+ * // Register multiple listeners
22
+ * onNotificationOpened(message => {
23
+ * doSomething(message);
24
+ * });
25
+ *
26
+ * onNotificationOpened(message => {
27
+ * doSomethingElse(message);
28
+ * });
29
+ * ```
30
+ */
31
+ exports.onNotificationOpened = function () {
32
+ throw new utils_1.PlatformNotSupportedError();
33
+ };
@@ -0,0 +1,2 @@
1
+ import { OnNotificationOpened } from '../types';
2
+ export declare const onNotificationOpened: OnNotificationOpened;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var eventListeners_1 = require("../../../../eventListeners");
6
+ exports.onNotificationOpened = function (input) {
7
+ return eventListeners_1.addEventListener('notificationOpened', input);
8
+ };
@@ -0,0 +1,43 @@
1
+ import { OnNotificationReceivedInBackground } from '../types';
2
+ /**
3
+ * Registers a listener that will be triggered when a notification is received while app is in a background state.
4
+ *
5
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
6
+ * only React Native is supported by this API.
7
+ * @param {OnNotificationReceivedInBackgroundInput} input - A callback handler to be invoked with the received
8
+ * {@link PushNotificationMessage}.
9
+ * @returns {OnNotificationReceivedInBackgroundOutput} - An object with a remove function to remove the listener.
10
+ * @remarks Notifications received while app is in a quit state will start the app (as a headless JS instance running
11
+ * on a background service on Android) in the background. Handlers registered via this function should return promises
12
+ * if it needs to be asynchronous (e.g. to perform some network requests). The app should run in the background as long
13
+ * as there are handlers still running (however, if they run for more than 30 seconds on iOS, subsequent tasks could
14
+ * get deprioritized!). If it is necessary for a handler to execute while the app is in quit state, it should be
15
+ * registered in the application entry point (e.g. index.js) since the application will not fully mount in that case.
16
+ * @example
17
+ * ```ts
18
+ * // Register a listener
19
+ * onNotificationReceivedInBackground(message => {
20
+ * doSomething(message);
21
+ * });
22
+ * ```
23
+ * @example
24
+ * ```ts
25
+ * // Register multiple listeners
26
+ * onNotificationReceivedInBackground(message => {
27
+ * doSomething(message);
28
+ * });
29
+ *
30
+ * onNotificationReceivedInBackground(message => {
31
+ * doSomethingElse(message);
32
+ * });
33
+ * ```
34
+ * @example
35
+ * ```ts
36
+ * // Register async listener
37
+ * onNotificationReceivedInBackground(async message => {
38
+ * await doSomething(message);
39
+ * console.log(`did something with ${message}`);
40
+ * });
41
+ * ```
42
+ */
43
+ export declare const onNotificationReceivedInBackground: OnNotificationReceivedInBackground;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var utils_1 = require("@aws-amplify/core/internals/utils");
6
+ /**
7
+ * Registers a listener that will be triggered when a notification is received while app is in a background state.
8
+ *
9
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
10
+ * only React Native is supported by this API.
11
+ * @param {OnNotificationReceivedInBackgroundInput} input - A callback handler to be invoked with the received
12
+ * {@link PushNotificationMessage}.
13
+ * @returns {OnNotificationReceivedInBackgroundOutput} - An object with a remove function to remove the listener.
14
+ * @remarks Notifications received while app is in a quit state will start the app (as a headless JS instance running
15
+ * on a background service on Android) in the background. Handlers registered via this function should return promises
16
+ * if it needs to be asynchronous (e.g. to perform some network requests). The app should run in the background as long
17
+ * as there are handlers still running (however, if they run for more than 30 seconds on iOS, subsequent tasks could
18
+ * get deprioritized!). If it is necessary for a handler to execute while the app is in quit state, it should be
19
+ * registered in the application entry point (e.g. index.js) since the application will not fully mount in that case.
20
+ * @example
21
+ * ```ts
22
+ * // Register a listener
23
+ * onNotificationReceivedInBackground(message => {
24
+ * doSomething(message);
25
+ * });
26
+ * ```
27
+ * @example
28
+ * ```ts
29
+ * // Register multiple listeners
30
+ * onNotificationReceivedInBackground(message => {
31
+ * doSomething(message);
32
+ * });
33
+ *
34
+ * onNotificationReceivedInBackground(message => {
35
+ * doSomethingElse(message);
36
+ * });
37
+ * ```
38
+ * @example
39
+ * ```ts
40
+ * // Register async listener
41
+ * onNotificationReceivedInBackground(async message => {
42
+ * await doSomething(message);
43
+ * console.log(`did something with ${message}`);
44
+ * });
45
+ * ```
46
+ */
47
+ exports.onNotificationReceivedInBackground = function () {
48
+ throw new utils_1.PlatformNotSupportedError();
49
+ };
@@ -0,0 +1,2 @@
1
+ import { OnNotificationReceivedInBackground } from '../types';
2
+ export declare const onNotificationReceivedInBackground: OnNotificationReceivedInBackground;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var eventListeners_1 = require("../../../../eventListeners");
6
+ exports.onNotificationReceivedInBackground = function (input) { return eventListeners_1.addEventListener('backgroundMessageReceived', input); };
@@ -0,0 +1,27 @@
1
+ import { OnNotificationReceivedInForeground } from '../types';
2
+ /**
3
+ * Registers a listener that will be triggered when a notification is received while app is in a foreground state.
4
+ *
5
+ * @param {OnNotificationReceivedInForegroundInput} input - A callback handler to be invoked with the received
6
+ * {@link PushNotificationMessage}.
7
+ * @returns {OnNotificationReceivedInForegroundOutput} - An object with a remove function to remove the listener.
8
+ * @example
9
+ * ```ts
10
+ * // Register a listener
11
+ * onNotificationReceivedInForeground(message => {
12
+ * doSomething(message);
13
+ * });
14
+ * ```
15
+ * @example
16
+ * ```ts
17
+ * // Register multiple listeners
18
+ * onNotificationReceivedInForeground(message => {
19
+ * doSomething(message);
20
+ * });
21
+ *
22
+ * onNotificationReceivedInForeground(message => {
23
+ * doSomethingElse(message);
24
+ * });
25
+ * ```
26
+ */
27
+ export declare const onNotificationReceivedInForeground: OnNotificationReceivedInForeground;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var utils_1 = require("@aws-amplify/core/internals/utils");
6
+ /**
7
+ * Registers a listener that will be triggered when a notification is received while app is in a foreground state.
8
+ *
9
+ * @param {OnNotificationReceivedInForegroundInput} input - A callback handler to be invoked with the received
10
+ * {@link PushNotificationMessage}.
11
+ * @returns {OnNotificationReceivedInForegroundOutput} - An object with a remove function to remove the listener.
12
+ * @example
13
+ * ```ts
14
+ * // Register a listener
15
+ * onNotificationReceivedInForeground(message => {
16
+ * doSomething(message);
17
+ * });
18
+ * ```
19
+ * @example
20
+ * ```ts
21
+ * // Register multiple listeners
22
+ * onNotificationReceivedInForeground(message => {
23
+ * doSomething(message);
24
+ * });
25
+ *
26
+ * onNotificationReceivedInForeground(message => {
27
+ * doSomethingElse(message);
28
+ * });
29
+ * ```
30
+ */
31
+ exports.onNotificationReceivedInForeground = function () {
32
+ throw new utils_1.PlatformNotSupportedError();
33
+ };
@@ -0,0 +1,2 @@
1
+ import { OnNotificationReceivedInForeground } from '../types';
2
+ export declare const onNotificationReceivedInForeground: OnNotificationReceivedInForeground;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var eventListeners_1 = require("../../../../eventListeners");
6
+ exports.onNotificationReceivedInForeground = function (input) { return eventListeners_1.addEventListener('foregroundMessageReceived', input); };
@@ -0,0 +1,28 @@
1
+ import { OnTokenReceived } from '../types';
2
+ /**
3
+ * Registers a listener that will be triggered when a token is received. A token will be received:
4
+ * 1. On every app launch, including the first install
5
+ * 2. When a token changes (this may happen if the service invalidates the token for any reason)
6
+ *
7
+ * @param {OnTokenReceivedInput} input - A callback handler to be invoked with the token.
8
+ * @returns {OnTokenReceivedOutput} - An object with a remove function to remove the listener.
9
+ * @example
10
+ * ```ts
11
+ * // Register a listener
12
+ * onTokenReceived(message => {
13
+ * doSomething(message);
14
+ * });
15
+ * ```
16
+ * @example
17
+ * ```ts
18
+ * // Register multiple listeners
19
+ * onTokenReceived(message => {
20
+ * doSomething(message);
21
+ * });
22
+ *
23
+ * onTokenReceived(message => {
24
+ * doSomethingElse(message);
25
+ * });
26
+ * ```
27
+ */
28
+ export declare const onTokenReceived: OnTokenReceived;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var utils_1 = require("@aws-amplify/core/internals/utils");
6
+ /**
7
+ * Registers a listener that will be triggered when a token is received. A token will be received:
8
+ * 1. On every app launch, including the first install
9
+ * 2. When a token changes (this may happen if the service invalidates the token for any reason)
10
+ *
11
+ * @param {OnTokenReceivedInput} input - A callback handler to be invoked with the token.
12
+ * @returns {OnTokenReceivedOutput} - An object with a remove function to remove the listener.
13
+ * @example
14
+ * ```ts
15
+ * // Register a listener
16
+ * onTokenReceived(message => {
17
+ * doSomething(message);
18
+ * });
19
+ * ```
20
+ * @example
21
+ * ```ts
22
+ * // Register multiple listeners
23
+ * onTokenReceived(message => {
24
+ * doSomething(message);
25
+ * });
26
+ *
27
+ * onTokenReceived(message => {
28
+ * doSomethingElse(message);
29
+ * });
30
+ * ```
31
+ */
32
+ exports.onTokenReceived = function () {
33
+ throw new utils_1.PlatformNotSupportedError();
34
+ };
@@ -0,0 +1,2 @@
1
+ import { OnTokenReceived } from '../types';
2
+ export declare const onTokenReceived: OnTokenReceived;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var eventListeners_1 = require("../../../../eventListeners");
6
+ exports.onTokenReceived = function (input) {
7
+ return eventListeners_1.addEventListener('tokenReceived', input);
8
+ };
@@ -0,0 +1,32 @@
1
+ import { RequestPermissions } from '../types';
2
+ /**
3
+ * Requests notification permissions from your user. By default, Amplify requests all supported permissions but you can
4
+ * choose not to request specific permissions. The resulting promise will resolve to true if requested permissions are
5
+ * granted (or have previously been granted) or false otherwise. Not all specific permissions are supported by platforms
6
+ * your React Native app can run on but will be safely ignored even on those platforms. Currently supported permissions:
7
+ *
8
+ * * `alert`: When set to true, requests the ability to display notifications to the user.
9
+ *
10
+ * * `sound`: When set to true, requests the ability to play a sound in response to notifications.
11
+ *
12
+ * * `badge`: When set to true, requests the ability to update the app's badge.
13
+ *
14
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
15
+ * only React Native is supported by this API.
16
+ * @returns A promise that resolves to true if requested permissions are granted or have already previously been
17
+ * granted or false otherwise.
18
+ * @example
19
+ * ```ts
20
+ * // Request all permissions by default
21
+ * const arePermissionsGranted = await requestPermissions();
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * // Prevent requesting specific permissions
26
+ * const arePermissionsGranted = await requestPermissions({
27
+ * sound: false,
28
+ * badge: false
29
+ * });
30
+ * ```
31
+ */
32
+ export declare const requestPermissions: RequestPermissions;