@aws-amplify/notifications 2.0.1-console-preview.d745d43.0 → 2.0.1-ssr-api.df60e41.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 (458) hide show
  1. package/lib/eventListeners/eventListeners.js +7 -4
  2. package/lib/eventListeners/index.js +4 -4
  3. package/lib/eventListeners/types.d.ts +2 -2
  4. package/lib/eventListeners/types.js +0 -1
  5. package/lib/inAppMessaging/errors/InAppMessagingError.js +1 -1
  6. package/lib/inAppMessaging/errors/assertServiceError.js +1 -1
  7. package/lib/inAppMessaging/errors/assertValidationError.js +1 -1
  8. package/lib/inAppMessaging/errors/index.js +6 -6
  9. package/lib/inAppMessaging/errors/validation.js +1 -1
  10. package/lib/inAppMessaging/index.d.ts +1 -1
  11. package/lib/inAppMessaging/index.js +12 -11
  12. package/lib/inAppMessaging/providers/pinpoint/apis/clearMessages.d.ts +13 -0
  13. package/lib/inAppMessaging/providers/pinpoint/apis/clearMessages.js +26 -0
  14. package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +10 -8
  15. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -1
  16. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +8 -7
  17. package/lib/inAppMessaging/providers/pinpoint/apis/index.d.ts +1 -0
  18. package/lib/inAppMessaging/providers/pinpoint/apis/index.js +13 -11
  19. package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +11 -11
  20. package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +3 -3
  21. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +3 -3
  22. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +3 -3
  23. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +3 -3
  24. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +3 -3
  25. package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +2 -2
  26. package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js +9 -9
  27. package/lib/inAppMessaging/providers/pinpoint/index.d.ts +1 -1
  28. package/lib/inAppMessaging/providers/pinpoint/index.js +12 -11
  29. package/lib/inAppMessaging/providers/pinpoint/types/index.js +2 -2
  30. package/lib/inAppMessaging/providers/pinpoint/types/inputs.d.ts +8 -8
  31. package/lib/inAppMessaging/providers/pinpoint/types/inputs.js +0 -1
  32. package/lib/inAppMessaging/providers/pinpoint/types/options.d.ts +1 -1
  33. package/lib/inAppMessaging/providers/pinpoint/types/options.js +0 -1
  34. package/lib/inAppMessaging/providers/pinpoint/types/outputs.d.ts +4 -4
  35. package/lib/inAppMessaging/providers/pinpoint/types/outputs.js +0 -1
  36. package/lib/inAppMessaging/providers/pinpoint/types/types.d.ts +6 -6
  37. package/lib/inAppMessaging/providers/pinpoint/types/types.js +1 -1
  38. package/lib/inAppMessaging/providers/pinpoint/utils/constants.js +1 -1
  39. package/lib/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +2 -2
  40. package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js +38 -24
  41. package/lib/inAppMessaging/providers/pinpoint/utils/index.js +11 -11
  42. package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +8 -8
  43. package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +5 -4
  44. package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +5 -4
  45. package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js +3 -3
  46. package/lib/inAppMessaging/types/event.d.ts +2 -2
  47. package/lib/inAppMessaging/types/event.js +0 -1
  48. package/lib/inAppMessaging/types/index.js +0 -1
  49. package/lib/inAppMessaging/types/inputs.d.ts +1 -1
  50. package/lib/inAppMessaging/types/inputs.js +0 -1
  51. package/lib/inAppMessaging/types/message.d.ts +3 -3
  52. package/lib/inAppMessaging/types/message.js +0 -1
  53. package/lib/inAppMessaging/types/options.d.ts +1 -1
  54. package/lib/inAppMessaging/types/options.js +0 -1
  55. package/lib/inAppMessaging/utils/index.js +4 -4
  56. package/lib/inAppMessaging/utils/statusHelpers.js +6 -4
  57. package/lib/index.js +0 -1
  58. package/lib/pushNotifications/errors/PushNotificationError.js +1 -1
  59. package/lib/pushNotifications/errors/errorHelpers.js +5 -4
  60. package/lib/pushNotifications/errors/index.js +4 -4
  61. package/lib/pushNotifications/index.js +13 -13
  62. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +3 -2
  63. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +5 -4
  64. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +3 -2
  65. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +5 -4
  66. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +3 -2
  67. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +5 -4
  68. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js +3 -2
  69. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +9 -8
  70. package/lib/pushNotifications/providers/pinpoint/apis/index.js +12 -12
  71. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +3 -2
  72. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +45 -36
  73. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +3 -2
  74. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +5 -4
  75. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +3 -2
  76. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +5 -4
  77. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +3 -2
  78. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +5 -4
  79. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +3 -2
  80. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +5 -4
  81. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.js +3 -2
  82. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +5 -4
  83. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +3 -2
  84. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +5 -4
  85. package/lib/pushNotifications/providers/pinpoint/index.js +12 -12
  86. package/lib/pushNotifications/providers/pinpoint/types/analytics.d.ts +3 -3
  87. package/lib/pushNotifications/providers/pinpoint/types/analytics.js +0 -1
  88. package/lib/pushNotifications/providers/pinpoint/types/apis.d.ts +11 -11
  89. package/lib/pushNotifications/providers/pinpoint/types/apis.js +0 -1
  90. package/lib/pushNotifications/providers/pinpoint/types/index.js +0 -1
  91. package/lib/pushNotifications/providers/pinpoint/types/inputs.d.ts +7 -7
  92. package/lib/pushNotifications/providers/pinpoint/types/inputs.js +0 -1
  93. package/lib/pushNotifications/providers/pinpoint/types/options.d.ts +1 -1
  94. package/lib/pushNotifications/providers/pinpoint/types/options.js +0 -1
  95. package/lib/pushNotifications/providers/pinpoint/types/outputs.d.ts +8 -8
  96. package/lib/pushNotifications/providers/pinpoint/types/outputs.js +0 -1
  97. package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +1 -1
  98. package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.js +0 -1
  99. package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +3 -2
  100. package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +10 -8
  101. package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +3 -2
  102. package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +3 -2
  103. package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +2 -1
  104. package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.js +4 -3
  105. package/lib/pushNotifications/providers/pinpoint/utils/index.d.ts +2 -1
  106. package/lib/pushNotifications/providers/pinpoint/utils/index.js +7 -5
  107. package/lib/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.js +6 -5
  108. package/lib/pushNotifications/types/errors.js +1 -1
  109. package/lib/pushNotifications/types/index.js +19 -3
  110. package/lib/pushNotifications/types/inputs.d.ts +7 -7
  111. package/lib/pushNotifications/types/inputs.js +0 -1
  112. package/lib/pushNotifications/types/options.d.ts +1 -1
  113. package/lib/pushNotifications/types/options.js +0 -1
  114. package/lib/pushNotifications/types/outputs.d.ts +8 -8
  115. package/lib/pushNotifications/types/outputs.js +0 -1
  116. package/lib/pushNotifications/types/pushNotifications.d.ts +3 -3
  117. package/lib/pushNotifications/types/pushNotifications.js +0 -1
  118. package/lib/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.js +3 -2
  119. package/lib/pushNotifications/utils/index.d.ts +1 -1
  120. package/lib/pushNotifications/utils/index.js +8 -8
  121. package/lib/pushNotifications/utils/initializationManager.js +5 -3
  122. package/lib/pushNotifications/utils/resolveCredentials.js +5 -4
  123. package/lib/pushNotifications/utils/tokenManager.js +5 -3
  124. package/lib/tsconfig.tsbuildinfo +1 -7201
  125. package/lib-esm/eventListeners/eventListeners.js +0 -1
  126. package/lib-esm/eventListeners/index.js +0 -1
  127. package/lib-esm/eventListeners/types.d.ts +2 -2
  128. package/lib-esm/eventListeners/types.js +1 -1
  129. package/lib-esm/inAppMessaging/errors/InAppMessagingError.js +0 -1
  130. package/lib-esm/inAppMessaging/errors/assertServiceError.js +0 -1
  131. package/lib-esm/inAppMessaging/errors/assertValidationError.js +0 -1
  132. package/lib-esm/inAppMessaging/errors/index.js +0 -1
  133. package/lib-esm/inAppMessaging/errors/validation.js +0 -1
  134. package/lib-esm/inAppMessaging/index.d.ts +1 -1
  135. package/lib-esm/inAppMessaging/index.js +1 -2
  136. package/lib-esm/inAppMessaging/providers/pinpoint/apis/clearMessages.d.ts +13 -0
  137. package/lib-esm/inAppMessaging/providers/pinpoint/apis/clearMessages.js +22 -0
  138. package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +0 -1
  139. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -1
  140. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +0 -1
  141. package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.d.ts +1 -0
  142. package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js +1 -1
  143. package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +0 -1
  144. package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +0 -1
  145. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +0 -1
  146. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +0 -1
  147. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +0 -1
  148. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +0 -1
  149. package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +0 -1
  150. package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js +0 -1
  151. package/lib-esm/inAppMessaging/providers/pinpoint/index.d.ts +1 -1
  152. package/lib-esm/inAppMessaging/providers/pinpoint/index.js +1 -2
  153. package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js +0 -1
  154. package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.d.ts +8 -8
  155. package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js +1 -1
  156. package/lib-esm/inAppMessaging/providers/pinpoint/types/options.d.ts +1 -1
  157. package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js +1 -1
  158. package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.d.ts +4 -4
  159. package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js +1 -1
  160. package/lib-esm/inAppMessaging/providers/pinpoint/types/types.d.ts +6 -6
  161. package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js +0 -1
  162. package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js +0 -1
  163. package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +2 -2
  164. package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js +0 -1
  165. package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js +0 -1
  166. package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +0 -1
  167. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +0 -1
  168. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +0 -1
  169. package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js +0 -1
  170. package/lib-esm/inAppMessaging/types/event.d.ts +2 -2
  171. package/lib-esm/inAppMessaging/types/event.js +1 -1
  172. package/lib-esm/inAppMessaging/types/index.js +1 -1
  173. package/lib-esm/inAppMessaging/types/inputs.d.ts +1 -1
  174. package/lib-esm/inAppMessaging/types/inputs.js +1 -1
  175. package/lib-esm/inAppMessaging/types/message.d.ts +3 -3
  176. package/lib-esm/inAppMessaging/types/message.js +1 -1
  177. package/lib-esm/inAppMessaging/types/options.d.ts +1 -1
  178. package/lib-esm/inAppMessaging/types/options.js +1 -1
  179. package/lib-esm/inAppMessaging/utils/index.js +0 -1
  180. package/lib-esm/inAppMessaging/utils/statusHelpers.js +0 -1
  181. package/lib-esm/index.js +0 -1
  182. package/lib-esm/pushNotifications/errors/PushNotificationError.js +0 -1
  183. package/lib-esm/pushNotifications/errors/errorHelpers.js +0 -1
  184. package/lib-esm/pushNotifications/errors/index.js +0 -1
  185. package/lib-esm/pushNotifications/index.js +0 -1
  186. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +1 -2
  187. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +0 -1
  188. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +1 -2
  189. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +1 -2
  190. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +1 -2
  191. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +1 -2
  192. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js +1 -2
  193. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +2 -3
  194. package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js +0 -1
  195. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +0 -1
  196. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +30 -23
  197. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +0 -1
  198. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +0 -1
  199. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +0 -1
  200. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +0 -1
  201. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +0 -1
  202. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +0 -1
  203. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +0 -1
  204. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +0 -1
  205. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.js +1 -2
  206. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +1 -2
  207. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +0 -1
  208. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +0 -1
  209. package/lib-esm/pushNotifications/providers/pinpoint/index.js +0 -1
  210. package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.d.ts +3 -3
  211. package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.js +1 -1
  212. package/lib-esm/pushNotifications/providers/pinpoint/types/apis.d.ts +11 -11
  213. package/lib-esm/pushNotifications/providers/pinpoint/types/apis.js +1 -1
  214. package/lib-esm/pushNotifications/providers/pinpoint/types/index.js +1 -1
  215. package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.d.ts +7 -7
  216. package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.js +1 -1
  217. package/lib-esm/pushNotifications/providers/pinpoint/types/options.d.ts +1 -1
  218. package/lib-esm/pushNotifications/providers/pinpoint/types/options.js +1 -1
  219. package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.d.ts +8 -8
  220. package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.js +1 -1
  221. package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +1 -1
  222. package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.js +1 -1
  223. package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +3 -2
  224. package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +2 -2
  225. package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +3 -2
  226. package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +0 -1
  227. package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +2 -1
  228. package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.js +0 -1
  229. package/lib-esm/pushNotifications/providers/pinpoint/utils/index.d.ts +2 -1
  230. package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js +2 -2
  231. package/lib-esm/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.js +1 -2
  232. package/lib-esm/pushNotifications/types/errors.js +0 -1
  233. package/lib-esm/pushNotifications/types/index.js +4 -1
  234. package/lib-esm/pushNotifications/types/inputs.d.ts +7 -7
  235. package/lib-esm/pushNotifications/types/inputs.js +1 -1
  236. package/lib-esm/pushNotifications/types/options.d.ts +1 -1
  237. package/lib-esm/pushNotifications/types/options.js +1 -1
  238. package/lib-esm/pushNotifications/types/outputs.d.ts +8 -8
  239. package/lib-esm/pushNotifications/types/outputs.js +1 -1
  240. package/lib-esm/pushNotifications/types/pushNotifications.d.ts +3 -3
  241. package/lib-esm/pushNotifications/types/pushNotifications.js +1 -1
  242. package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.js +0 -1
  243. package/lib-esm/pushNotifications/utils/index.d.ts +1 -1
  244. package/lib-esm/pushNotifications/utils/index.js +1 -2
  245. package/lib-esm/pushNotifications/utils/initializationManager.js +0 -1
  246. package/lib-esm/pushNotifications/utils/resolveCredentials.js +0 -1
  247. package/lib-esm/pushNotifications/utils/tokenManager.js +0 -1
  248. package/lib-esm/tsconfig.tsbuildinfo +1 -7201
  249. package/package.json +51 -14
  250. package/src/inAppMessaging/index.ts +1 -0
  251. package/src/inAppMessaging/providers/pinpoint/apis/clearMessages.ts +26 -0
  252. package/src/inAppMessaging/providers/pinpoint/apis/index.ts +1 -0
  253. package/src/inAppMessaging/providers/pinpoint/index.ts +1 -0
  254. package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.ts +1 -1
  255. package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.ts +1 -1
  256. package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.ts +1 -1
  257. package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.ts +1 -1
  258. package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.ts +1 -1
  259. package/src/pushNotifications/providers/pinpoint/apis/identifyUser.native.ts +5 -2
  260. package/src/pushNotifications/providers/pinpoint/apis/identifyUser.ts +1 -1
  261. package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.ts +50 -40
  262. package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.native.ts +1 -1
  263. package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.ts +1 -1
  264. package/src/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.ts +5 -4
  265. package/src/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.ts +3 -3
  266. package/src/pushNotifications/providers/pinpoint/utils/index.ts +2 -1
  267. package/src/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.ts +1 -1
  268. package/src/pushNotifications/types/pushNotifications.ts +1 -1
  269. package/src/pushNotifications/utils/index.ts +1 -1
  270. package/lib/eventListeners/eventListeners.js.map +0 -1
  271. package/lib/eventListeners/index.js.map +0 -1
  272. package/lib/eventListeners/types.js.map +0 -1
  273. package/lib/inAppMessaging/errors/InAppMessagingError.js.map +0 -1
  274. package/lib/inAppMessaging/errors/assertServiceError.js.map +0 -1
  275. package/lib/inAppMessaging/errors/assertValidationError.js.map +0 -1
  276. package/lib/inAppMessaging/errors/index.js.map +0 -1
  277. package/lib/inAppMessaging/errors/validation.js.map +0 -1
  278. package/lib/inAppMessaging/index.js.map +0 -1
  279. package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js.map +0 -1
  280. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +0 -1
  281. package/lib/inAppMessaging/providers/pinpoint/apis/index.js.map +0 -1
  282. package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js.map +0 -1
  283. package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js.map +0 -1
  284. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js.map +0 -1
  285. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js.map +0 -1
  286. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js.map +0 -1
  287. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js.map +0 -1
  288. package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js.map +0 -1
  289. package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +0 -1
  290. package/lib/inAppMessaging/providers/pinpoint/index.js.map +0 -1
  291. package/lib/inAppMessaging/providers/pinpoint/types/index.js.map +0 -1
  292. package/lib/inAppMessaging/providers/pinpoint/types/inputs.js.map +0 -1
  293. package/lib/inAppMessaging/providers/pinpoint/types/options.js.map +0 -1
  294. package/lib/inAppMessaging/providers/pinpoint/types/outputs.js.map +0 -1
  295. package/lib/inAppMessaging/providers/pinpoint/types/types.js.map +0 -1
  296. package/lib/inAppMessaging/providers/pinpoint/utils/constants.js.map +0 -1
  297. package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js.map +0 -1
  298. package/lib/inAppMessaging/providers/pinpoint/utils/index.js.map +0 -1
  299. package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js.map +0 -1
  300. package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js.map +0 -1
  301. package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js.map +0 -1
  302. package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js.map +0 -1
  303. package/lib/inAppMessaging/types/event.js.map +0 -1
  304. package/lib/inAppMessaging/types/index.js.map +0 -1
  305. package/lib/inAppMessaging/types/inputs.js.map +0 -1
  306. package/lib/inAppMessaging/types/message.js.map +0 -1
  307. package/lib/inAppMessaging/types/options.js.map +0 -1
  308. package/lib/inAppMessaging/utils/index.js.map +0 -1
  309. package/lib/inAppMessaging/utils/statusHelpers.js.map +0 -1
  310. package/lib/index.js.map +0 -1
  311. package/lib/pushNotifications/errors/PushNotificationError.js.map +0 -1
  312. package/lib/pushNotifications/errors/errorHelpers.js.map +0 -1
  313. package/lib/pushNotifications/errors/index.js.map +0 -1
  314. package/lib/pushNotifications/index.js.map +0 -1
  315. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.js.map +0 -1
  316. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js.map +0 -1
  317. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js.map +0 -1
  318. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js.map +0 -1
  319. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js.map +0 -1
  320. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js.map +0 -1
  321. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js.map +0 -1
  322. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js.map +0 -1
  323. package/lib/pushNotifications/providers/pinpoint/apis/index.js.map +0 -1
  324. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js.map +0 -1
  325. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js.map +0 -1
  326. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js.map +0 -1
  327. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js.map +0 -1
  328. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js.map +0 -1
  329. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js.map +0 -1
  330. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js.map +0 -1
  331. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js.map +0 -1
  332. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.js.map +0 -1
  333. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js.map +0 -1
  334. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.js.map +0 -1
  335. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js.map +0 -1
  336. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.js.map +0 -1
  337. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js.map +0 -1
  338. package/lib/pushNotifications/providers/pinpoint/index.js.map +0 -1
  339. package/lib/pushNotifications/providers/pinpoint/types/analytics.js.map +0 -1
  340. package/lib/pushNotifications/providers/pinpoint/types/apis.js.map +0 -1
  341. package/lib/pushNotifications/providers/pinpoint/types/index.js.map +0 -1
  342. package/lib/pushNotifications/providers/pinpoint/types/inputs.js.map +0 -1
  343. package/lib/pushNotifications/providers/pinpoint/types/options.js.map +0 -1
  344. package/lib/pushNotifications/providers/pinpoint/types/outputs.js.map +0 -1
  345. package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.js.map +0 -1
  346. package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js.map +0 -1
  347. package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js.map +0 -1
  348. package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.js.map +0 -1
  349. package/lib/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js.map +0 -1
  350. package/lib/pushNotifications/providers/pinpoint/utils/index.js.map +0 -1
  351. package/lib/pushNotifications/types/errors.js.map +0 -1
  352. package/lib/pushNotifications/types/index.js.map +0 -1
  353. package/lib/pushNotifications/types/inputs.js.map +0 -1
  354. package/lib/pushNotifications/types/options.js.map +0 -1
  355. package/lib/pushNotifications/types/outputs.js.map +0 -1
  356. package/lib/pushNotifications/types/pushNotifications.js.map +0 -1
  357. package/lib/pushNotifications/utils/index.js.map +0 -1
  358. package/lib/pushNotifications/utils/initializationManager.js.map +0 -1
  359. package/lib/pushNotifications/utils/resolveConfig.js.map +0 -1
  360. package/lib/pushNotifications/utils/resolveCredentials.js.map +0 -1
  361. package/lib/pushNotifications/utils/tokenManager.js.map +0 -1
  362. package/lib-esm/eventListeners/eventListeners.js.map +0 -1
  363. package/lib-esm/eventListeners/index.js.map +0 -1
  364. package/lib-esm/eventListeners/types.js.map +0 -1
  365. package/lib-esm/inAppMessaging/errors/InAppMessagingError.js.map +0 -1
  366. package/lib-esm/inAppMessaging/errors/assertServiceError.js.map +0 -1
  367. package/lib-esm/inAppMessaging/errors/assertValidationError.js.map +0 -1
  368. package/lib-esm/inAppMessaging/errors/index.js.map +0 -1
  369. package/lib-esm/inAppMessaging/errors/validation.js.map +0 -1
  370. package/lib-esm/inAppMessaging/index.js.map +0 -1
  371. package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js.map +0 -1
  372. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +0 -1
  373. package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js.map +0 -1
  374. package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js.map +0 -1
  375. package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js.map +0 -1
  376. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js.map +0 -1
  377. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js.map +0 -1
  378. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js.map +0 -1
  379. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js.map +0 -1
  380. package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js.map +0 -1
  381. package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +0 -1
  382. package/lib-esm/inAppMessaging/providers/pinpoint/index.js.map +0 -1
  383. package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js.map +0 -1
  384. package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js.map +0 -1
  385. package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js.map +0 -1
  386. package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js.map +0 -1
  387. package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js.map +0 -1
  388. package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js.map +0 -1
  389. package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js.map +0 -1
  390. package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js.map +0 -1
  391. package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js.map +0 -1
  392. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js.map +0 -1
  393. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js.map +0 -1
  394. package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js.map +0 -1
  395. package/lib-esm/inAppMessaging/types/event.js.map +0 -1
  396. package/lib-esm/inAppMessaging/types/index.js.map +0 -1
  397. package/lib-esm/inAppMessaging/types/inputs.js.map +0 -1
  398. package/lib-esm/inAppMessaging/types/message.js.map +0 -1
  399. package/lib-esm/inAppMessaging/types/options.js.map +0 -1
  400. package/lib-esm/inAppMessaging/utils/index.js.map +0 -1
  401. package/lib-esm/inAppMessaging/utils/statusHelpers.js.map +0 -1
  402. package/lib-esm/index.js.map +0 -1
  403. package/lib-esm/pushNotifications/errors/PushNotificationError.js.map +0 -1
  404. package/lib-esm/pushNotifications/errors/errorHelpers.js.map +0 -1
  405. package/lib-esm/pushNotifications/errors/index.js.map +0 -1
  406. package/lib-esm/pushNotifications/index.js.map +0 -1
  407. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.js.map +0 -1
  408. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js.map +0 -1
  409. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js.map +0 -1
  410. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js.map +0 -1
  411. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js.map +0 -1
  412. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js.map +0 -1
  413. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js.map +0 -1
  414. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js.map +0 -1
  415. package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js.map +0 -1
  416. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js.map +0 -1
  417. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js.map +0 -1
  418. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js.map +0 -1
  419. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js.map +0 -1
  420. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js.map +0 -1
  421. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js.map +0 -1
  422. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js.map +0 -1
  423. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js.map +0 -1
  424. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.js.map +0 -1
  425. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js.map +0 -1
  426. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.js.map +0 -1
  427. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js.map +0 -1
  428. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.js.map +0 -1
  429. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js.map +0 -1
  430. package/lib-esm/pushNotifications/providers/pinpoint/index.js.map +0 -1
  431. package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.js.map +0 -1
  432. package/lib-esm/pushNotifications/providers/pinpoint/types/apis.js.map +0 -1
  433. package/lib-esm/pushNotifications/providers/pinpoint/types/index.js.map +0 -1
  434. package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.js.map +0 -1
  435. package/lib-esm/pushNotifications/providers/pinpoint/types/options.js.map +0 -1
  436. package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.js.map +0 -1
  437. package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.js.map +0 -1
  438. package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js.map +0 -1
  439. package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js.map +0 -1
  440. package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.js.map +0 -1
  441. package/lib-esm/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js.map +0 -1
  442. package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js.map +0 -1
  443. package/lib-esm/pushNotifications/types/errors.js.map +0 -1
  444. package/lib-esm/pushNotifications/types/index.js.map +0 -1
  445. package/lib-esm/pushNotifications/types/inputs.js.map +0 -1
  446. package/lib-esm/pushNotifications/types/options.js.map +0 -1
  447. package/lib-esm/pushNotifications/types/outputs.js.map +0 -1
  448. package/lib-esm/pushNotifications/types/pushNotifications.js.map +0 -1
  449. package/lib-esm/pushNotifications/utils/index.js.map +0 -1
  450. package/lib-esm/pushNotifications/utils/initializationManager.js.map +0 -1
  451. package/lib-esm/pushNotifications/utils/resolveConfig.js.map +0 -1
  452. package/lib-esm/pushNotifications/utils/resolveCredentials.js.map +0 -1
  453. package/lib-esm/pushNotifications/utils/tokenManager.js.map +0 -1
  454. /package/lib/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.d.ts +0 -0
  455. /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.d.ts +0 -0
  456. /package/lib-esm/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.d.ts +0 -0
  457. /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.d.ts +0 -0
  458. /package/src/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.ts +0 -0
@@ -11,4 +11,3 @@ export { onNotificationReceivedInForeground } from './onNotificationReceivedInFo
11
11
  export { onTokenReceived } from './onTokenReceived';
12
12
  export { requestPermissions } from './requestPermissions';
13
13
  export { setBadgeCount } from './setBadgeCount';
14
- //# sourceMappingURL=index.js.map
@@ -19,4 +19,3 @@ import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
19
19
  export const initializePushNotifications = () => {
20
20
  throw new PlatformNotSupportedError();
21
21
  };
22
- //# sourceMappingURL=initializePushNotifications.js.map
@@ -5,8 +5,8 @@ import { PushNotificationAction } from '@aws-amplify/core/internals/utils';
5
5
  import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
6
6
  import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
7
7
  import { addEventListener, notifyEventListeners, notifyEventListenersAndAwaitHandlers, } from '../../../../eventListeners';
8
- import { getToken, initialize, isInitialized, resolveConfig, resolveCredentials, setToken, } from '../../../utils';
9
- import { createMessageEventRecorder, getChannelType, getPushNotificationUserAgentString, } from '../utils';
8
+ import { getPushNotificationUserAgentString, getToken, initialize, isInitialized, resolveCredentials, setToken, } from '../../../utils';
9
+ import { createMessageEventRecorder, getChannelType, resolveConfig, } from '../utils';
10
10
  const { addMessageEventListener, addTokenEventListener, completeNotification, getConstants, registerHeadlessTask, } = loadAmplifyPushNotification();
11
11
  const logger = new ConsoleLogger('Notifications.PushNotification');
12
12
  const BACKGROUND_TASK_TIMEOUT = 25; // seconds
@@ -19,19 +19,8 @@ export const initializePushNotifications = () => {
19
19
  addAnalyticsListeners();
20
20
  initialize();
21
21
  };
22
- const addAnalyticsListeners = () => {
23
- let launchNotificationOpenedListenerRemover;
24
- // wire up default Pinpoint message event handling
25
- addEventListener('backgroundMessageReceived', createMessageEventRecorder('backgroundMessageReceived'));
26
- addEventListener('foregroundMessageReceived', createMessageEventRecorder('foregroundMessageReceived'));
27
- launchNotificationOpenedListenerRemover = addEventListener('launchNotificationsOpened', createMessageEventRecorder('notificationOpened',
28
- // once we are done with it we can remove the listener
29
- launchNotificationOpenedListenerRemover?.remove));
30
- addEventListener('notificationOpened', createMessageEventRecorder('notificationOpened',
31
- // if we are in this state, we no longer need the listener as the app was launched via some other means
32
- launchNotificationOpenedListenerRemover?.remove));
33
- };
34
22
  const addNativeListeners = () => {
23
+ let launchNotificationOpenedListener;
35
24
  const { NativeEvent, NativeHeadlessTaskKey } = getConstants();
36
25
  const { BACKGROUND_MESSAGE_RECEIVED, FOREGROUND_MESSAGE_RECEIVED, LAUNCH_NOTIFICATION_OPENED, NOTIFICATION_OPENED, TOKEN_RECEIVED, } = NativeEvent;
37
26
  // on platforms that can handle headless tasks, register one to broadcast background message received to
@@ -63,8 +52,9 @@ const addNativeListeners = () => {
63
52
  }
64
53
  finally {
65
54
  // notify native module that handlers have completed their work (or timed out)
66
- if (completionHandlerId)
55
+ if (completionHandlerId) {
67
56
  completeNotification(completionHandlerId);
57
+ }
68
58
  }
69
59
  });
70
60
  }
@@ -73,13 +63,13 @@ const addNativeListeners = () => {
73
63
  FOREGROUND_MESSAGE_RECEIVED, message => {
74
64
  notifyEventListeners('foregroundMessageReceived', message);
75
65
  });
76
- const launchNotificationOpenedListener = LAUNCH_NOTIFICATION_OPENED
66
+ launchNotificationOpenedListener = LAUNCH_NOTIFICATION_OPENED
77
67
  ? addMessageEventListener(
78
68
  // listen for native notification opened app (user tapped on notification, opening the app from quit -
79
69
  // not background - state) event. This is broadcasted to an internal listener only as it is not intended
80
70
  // for use otherwise as it produces inconsistent results when used within React Native app context
81
71
  LAUNCH_NOTIFICATION_OPENED, message => {
82
- notifyEventListeners('launchNotificationsOpened', message);
72
+ notifyEventListeners('launchNotificationOpened', message);
83
73
  // once we are done with it we can remove the listener
84
74
  launchNotificationOpenedListener?.remove();
85
75
  })
@@ -95,21 +85,39 @@ const addNativeListeners = () => {
95
85
  addTokenEventListener(
96
86
  // listen for native new token event, automatically re-register device with provider using new token and
97
87
  // broadcast to library listeners
98
- TOKEN_RECEIVED, token => {
88
+ TOKEN_RECEIVED, async (token) => {
99
89
  // avoid a race condition where two endpoints are created with the same token on a fresh install
100
90
  if (getToken() === token) {
101
91
  return;
102
92
  }
103
93
  setToken(token);
104
- registerDevice();
105
94
  notifyEventListeners('tokenReceived', token);
95
+ try {
96
+ await registerDevice(token);
97
+ }
98
+ catch (err) {
99
+ logger.error('Failed to register device for push notifications', err);
100
+ throw err;
101
+ }
106
102
  });
107
103
  };
108
- const registerDevice = async () => {
104
+ const addAnalyticsListeners = () => {
105
+ let launchNotificationOpenedListenerRemover;
106
+ // wire up default Pinpoint message event handling
107
+ addEventListener('backgroundMessageReceived', createMessageEventRecorder('received_background'));
108
+ addEventListener('foregroundMessageReceived', createMessageEventRecorder('received_foreground'));
109
+ launchNotificationOpenedListenerRemover = addEventListener('launchNotificationOpened', createMessageEventRecorder('opened_notification',
110
+ // once we are done with it we can remove the listener
111
+ launchNotificationOpenedListenerRemover?.remove));
112
+ addEventListener('notificationOpened', createMessageEventRecorder('opened_notification',
113
+ // if we are in this state, we no longer need the listener as the app was launched via some other means
114
+ launchNotificationOpenedListenerRemover?.remove));
115
+ };
116
+ const registerDevice = async (address) => {
109
117
  const { credentials, identityId } = await resolveCredentials();
110
118
  const { appId, region } = resolveConfig();
111
- return updateEndpoint({
112
- address: getToken(),
119
+ await updateEndpoint({
120
+ address,
113
121
  appId,
114
122
  category: 'PushNotification',
115
123
  credentials,
@@ -119,4 +127,3 @@ const registerDevice = async () => {
119
127
  userAgentValue: getPushNotificationUserAgentString(PushNotificationAction.InitializePushNotifications),
120
128
  });
121
129
  };
122
- //# sourceMappingURL=initializePushNotifications.native.js.map
@@ -29,4 +29,3 @@ import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
29
29
  export const onNotificationOpened = () => {
30
30
  throw new PlatformNotSupportedError();
31
31
  };
32
- //# sourceMappingURL=onNotificationOpened.js.map
@@ -6,4 +6,3 @@ export const onNotificationOpened = input => {
6
6
  assertIsInitialized();
7
7
  return addEventListener('notificationOpened', input);
8
8
  };
9
- //# sourceMappingURL=onNotificationOpened.native.js.map
@@ -45,4 +45,3 @@ import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
45
45
  export const onNotificationReceivedInBackground = () => {
46
46
  throw new PlatformNotSupportedError();
47
47
  };
48
- //# sourceMappingURL=onNotificationReceivedInBackground.js.map
@@ -6,4 +6,3 @@ export const onNotificationReceivedInBackground = input => {
6
6
  assertIsInitialized();
7
7
  return addEventListener('backgroundMessageReceived', input);
8
8
  };
9
- //# sourceMappingURL=onNotificationReceivedInBackground.native.js.map
@@ -29,4 +29,3 @@ import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
29
29
  export const onNotificationReceivedInForeground = () => {
30
30
  throw new PlatformNotSupportedError();
31
31
  };
32
- //# sourceMappingURL=onNotificationReceivedInForeground.js.map
@@ -6,4 +6,3 @@ export const onNotificationReceivedInForeground = input => {
6
6
  assertIsInitialized();
7
7
  return addEventListener('foregroundMessageReceived', input);
8
8
  };
9
- //# sourceMappingURL=onNotificationReceivedInForeground.native.js.map
@@ -30,4 +30,3 @@ import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
30
30
  export const onTokenReceived = () => {
31
31
  throw new PlatformNotSupportedError();
32
32
  };
33
- //# sourceMappingURL=onTokenReceived.js.map
@@ -6,4 +6,3 @@ export const onTokenReceived = input => {
6
6
  assertIsInitialized();
7
7
  return addEventListener('tokenReceived', input);
8
8
  };
9
- //# sourceMappingURL=onTokenReceived.native.js.map
@@ -31,7 +31,6 @@ import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
31
31
  * });
32
32
  * ```
33
33
  */
34
- export const requestPermissions = () => {
34
+ export const requestPermissions = async () => {
35
35
  throw new PlatformNotSupportedError();
36
36
  };
37
- //# sourceMappingURL=requestPermissions.js.map
@@ -3,8 +3,7 @@
3
3
  import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
4
4
  import { assertIsInitialized } from '../../../errors/errorHelpers';
5
5
  const { requestPermissions: requestPermissionsNative } = loadAmplifyPushNotification();
6
- export const requestPermissions = input => {
6
+ export const requestPermissions = async (input) => {
7
7
  assertIsInitialized();
8
8
  return requestPermissionsNative(input);
9
9
  };
10
- //# sourceMappingURL=requestPermissions.native.js.map
@@ -16,4 +16,3 @@ import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
16
16
  export const setBadgeCount = () => {
17
17
  throw new PlatformNotSupportedError();
18
18
  };
19
- //# sourceMappingURL=setBadgeCount.js.map
@@ -7,4 +7,3 @@ export const setBadgeCount = input => {
7
7
  assertIsInitialized();
8
8
  setBadgeCountNative(input);
9
9
  };
10
- //# sourceMappingURL=setBadgeCount.native.js.map
@@ -1,4 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  export { getBadgeCount, getLaunchNotification, getPermissionStatus, identifyUser, initializePushNotifications, onNotificationOpened, onNotificationReceivedInBackground, onNotificationReceivedInForeground, onTokenReceived, requestPermissions, setBadgeCount, } from './apis';
4
- //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- export declare type PinpointMessageEvent = 'opened_notification' | 'received_background' | 'received_foreground';
2
- export declare type PinpointMessageEventSource = '_campaign' | '_journey';
3
- export declare type AnalyticsEventAttributes = {
1
+ export type PinpointMessageEvent = 'opened_notification' | 'received_background' | 'received_foreground';
2
+ export type PinpointMessageEventSource = '_campaign' | '_journey';
3
+ export type AnalyticsEventAttributes = {
4
4
  source: PinpointMessageEventSource;
5
5
  attributes: Record<string, string>;
6
6
  };
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- //# sourceMappingURL=analytics.js.map
3
+ export {};
@@ -1,13 +1,13 @@
1
1
  import { IdentifyUserInput, OnNotificationOpenedInput, OnNotificationReceivedInBackgroundInput, OnNotificationReceivedInForegroundInput, OnTokenReceivedInput, RequestPermissionsInput, SetBadgeCountInput } from './inputs';
2
2
  import { GetBadgeCountOutput, GetLaunchNotificationOutput, GetPermissionStatusOutput, OnNotificationOpenedOutput, OnNotificationReceivedInBackgroundOutput, OnNotificationReceivedInForegroundOutput, OnTokenReceivedOutput, RequestPermissionsOutput } from './outputs';
3
- export declare type GetBadgeCount = () => Promise<void | GetBadgeCountOutput>;
4
- export declare type GetLaunchNotification = () => Promise<GetLaunchNotificationOutput>;
5
- export declare type GetPermissionStatus = () => Promise<GetPermissionStatusOutput>;
6
- export declare type IdentifyUser = (input: IdentifyUserInput) => Promise<void>;
7
- export declare type InitializePushNotifications = () => void;
8
- export declare type RequestPermissions = (input?: RequestPermissionsInput) => Promise<RequestPermissionsOutput>;
9
- export declare type SetBadgeCount = (input: SetBadgeCountInput) => void;
10
- export declare type OnNotificationOpened = (input: OnNotificationOpenedInput) => OnNotificationOpenedOutput;
11
- export declare type OnNotificationReceivedInBackground = (input: OnNotificationReceivedInBackgroundInput) => OnNotificationReceivedInBackgroundOutput;
12
- export declare type OnNotificationReceivedInForeground = (input: OnNotificationReceivedInForegroundInput) => OnNotificationReceivedInForegroundOutput;
13
- export declare type OnTokenReceived = (input: OnTokenReceivedInput) => OnTokenReceivedOutput;
3
+ export type GetBadgeCount = () => Promise<void | GetBadgeCountOutput>;
4
+ export type GetLaunchNotification = () => Promise<GetLaunchNotificationOutput>;
5
+ export type GetPermissionStatus = () => Promise<GetPermissionStatusOutput>;
6
+ export type IdentifyUser = (input: IdentifyUserInput) => Promise<void>;
7
+ export type InitializePushNotifications = () => void;
8
+ export type RequestPermissions = (input?: RequestPermissionsInput) => Promise<RequestPermissionsOutput>;
9
+ export type SetBadgeCount = (input: SetBadgeCountInput) => void;
10
+ export type OnNotificationOpened = (input: OnNotificationOpenedInput) => OnNotificationOpenedOutput;
11
+ export type OnNotificationReceivedInBackground = (input: OnNotificationReceivedInBackgroundInput) => OnNotificationReceivedInBackgroundOutput;
12
+ export type OnNotificationReceivedInForeground = (input: OnNotificationReceivedInForegroundInput) => OnNotificationReceivedInForegroundOutput;
13
+ export type OnTokenReceived = (input: OnTokenReceivedInput) => OnTokenReceivedOutput;
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- //# sourceMappingURL=apis.js.map
3
+ export {};
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- //# sourceMappingURL=index.js.map
3
+ export {};
@@ -1,9 +1,9 @@
1
1
  import { IdentifyUserOptions } from './options';
2
2
  import { PushNotificationIdentifyUserInput, PushNotificationRequestPermissionsInput, PushNotificationSetBadgeCountInput, PushNotificationOnNotificationOpenedInput, PushNotificationOnNotificationReceivedInBackgroundInput, PushNotificationOnNotificationReceivedInForegroundInput, PushNotificationOnTokenReceivedInput } from '../../../types';
3
- export declare type IdentifyUserInput = PushNotificationIdentifyUserInput<IdentifyUserOptions>;
4
- export declare type RequestPermissionsInput = PushNotificationRequestPermissionsInput;
5
- export declare type SetBadgeCountInput = PushNotificationSetBadgeCountInput;
6
- export declare type OnNotificationOpenedInput = PushNotificationOnNotificationOpenedInput;
7
- export declare type OnNotificationReceivedInBackgroundInput = PushNotificationOnNotificationReceivedInBackgroundInput;
8
- export declare type OnNotificationReceivedInForegroundInput = PushNotificationOnNotificationReceivedInForegroundInput;
9
- export declare type OnTokenReceivedInput = PushNotificationOnTokenReceivedInput;
3
+ export type IdentifyUserInput = PushNotificationIdentifyUserInput<IdentifyUserOptions>;
4
+ export type RequestPermissionsInput = PushNotificationRequestPermissionsInput;
5
+ export type SetBadgeCountInput = PushNotificationSetBadgeCountInput;
6
+ export type OnNotificationOpenedInput = PushNotificationOnNotificationOpenedInput;
7
+ export type OnNotificationReceivedInBackgroundInput = PushNotificationOnNotificationReceivedInBackgroundInput;
8
+ export type OnNotificationReceivedInForegroundInput = PushNotificationOnNotificationReceivedInForegroundInput;
9
+ export type OnTokenReceivedInput = PushNotificationOnTokenReceivedInput;
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- //# sourceMappingURL=inputs.js.map
3
+ export {};
@@ -2,4 +2,4 @@ import { PinpointServiceOptions } from '@aws-amplify/core/internals/providers/pi
2
2
  /**
3
3
  * Options specific to Pinpoint identityUser.
4
4
  */
5
- export declare type IdentifyUserOptions = PinpointServiceOptions;
5
+ export type IdentifyUserOptions = PinpointServiceOptions;
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- //# sourceMappingURL=options.js.map
3
+ export {};
@@ -1,9 +1,9 @@
1
1
  import { PushNotificationGetBadgeCountOutput, PushNotificationGetLaunchNotificationOutput, PushNotificationGetPermissionStatusOutput, PushNotificationOnNotificationOpenedOutput, PushNotificationOnNotificationReceivedInBackgroundOutput, PushNotificationOnNotificationReceivedInForegroundOutput, PushNotificationOnTokenReceivedOutput, PushNotificationRequestPermissionsOutput } from '../../../types';
2
- export declare type GetBadgeCountOutput = PushNotificationGetBadgeCountOutput;
3
- export declare type GetLaunchNotificationOutput = PushNotificationGetLaunchNotificationOutput;
4
- export declare type GetPermissionStatusOutput = PushNotificationGetPermissionStatusOutput;
5
- export declare type RequestPermissionsOutput = PushNotificationRequestPermissionsOutput;
6
- export declare type OnNotificationOpenedOutput = PushNotificationOnNotificationOpenedOutput;
7
- export declare type OnNotificationReceivedInBackgroundOutput = PushNotificationOnNotificationReceivedInBackgroundOutput;
8
- export declare type OnNotificationReceivedInForegroundOutput = PushNotificationOnNotificationReceivedInForegroundOutput;
9
- export declare type OnTokenReceivedOutput = PushNotificationOnTokenReceivedOutput;
2
+ export type GetBadgeCountOutput = PushNotificationGetBadgeCountOutput;
3
+ export type GetLaunchNotificationOutput = PushNotificationGetLaunchNotificationOutput;
4
+ export type GetPermissionStatusOutput = PushNotificationGetPermissionStatusOutput;
5
+ export type RequestPermissionsOutput = PushNotificationRequestPermissionsOutput;
6
+ export type OnNotificationOpenedOutput = PushNotificationOnNotificationOpenedOutput;
7
+ export type OnNotificationReceivedInBackgroundOutput = PushNotificationOnNotificationReceivedInBackgroundOutput;
8
+ export type OnNotificationReceivedInForegroundOutput = PushNotificationOnNotificationReceivedInForegroundOutput;
9
+ export type OnTokenReceivedOutput = PushNotificationOnTokenReceivedOutput;
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- //# sourceMappingURL=outputs.js.map
3
+ export {};
@@ -1,2 +1,2 @@
1
1
  import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
2
- export declare type ChannelType = Parameters<typeof updateEndpoint>[0]['channelType'];
2
+ export type ChannelType = Parameters<typeof updateEndpoint>[0]['channelType'];
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- //# sourceMappingURL=pushNotifications.js.map
3
+ export {};
@@ -1,5 +1,6 @@
1
- import { OnPushNotificationMessageHandler, PushNotificationEvent } from '../../../types';
1
+ import { PinpointMessageEvent } from '../types';
2
+ import { OnPushNotificationMessageHandler } from '../../../types';
2
3
  /**
3
4
  * @internal
4
5
  */
5
- export declare const createMessageEventRecorder: (event: PushNotificationEvent, callback?: Function | undefined) => OnPushNotificationMessageHandler;
6
+ export declare const createMessageEventRecorder: (event: PinpointMessageEvent, callback?: Function) => OnPushNotificationMessageHandler;
@@ -2,9 +2,10 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { record } from '@aws-amplify/core/internals/providers/pinpoint';
4
4
  import { ConsoleLogger } from '@aws-amplify/core';
5
+ import { resolveCredentials } from '../../../utils';
5
6
  import { getAnalyticsEvent } from './getAnalyticsEvent';
6
7
  import { getChannelType } from './getChannelType';
7
- import { resolveConfig, resolveCredentials } from '../../../utils';
8
+ import { resolveConfig } from './resolveConfig';
8
9
  const logger = new ConsoleLogger('PushNotification.recordMessageEvent');
9
10
  /**
10
11
  * @internal
@@ -36,4 +37,3 @@ const recordMessageEvent = async ({ appId, credentials, event, message, region,
36
37
  region,
37
38
  });
38
39
  };
39
- //# sourceMappingURL=createMessageEventRecorder.js.map
@@ -1,6 +1,7 @@
1
1
  import { PinpointAnalyticsEvent } from '@aws-amplify/core/internals/providers/pinpoint';
2
- import { PushNotificationEvent, PushNotificationMessage } from '../../../types';
2
+ import { PinpointMessageEvent } from '../types';
3
+ import { PushNotificationMessage } from '../../../types';
3
4
  /**
4
5
  * @internal
5
6
  */
6
- export declare const getAnalyticsEvent: ({ data }: PushNotificationMessage, event: PushNotificationEvent) => PinpointAnalyticsEvent | null;
7
+ export declare const getAnalyticsEvent: ({ data }: PushNotificationMessage, event: PinpointMessageEvent) => PinpointAnalyticsEvent | null;
@@ -50,4 +50,3 @@ const getAnalyticsEventAttributes = (data) => {
50
50
  };
51
51
  }
52
52
  };
53
- //# sourceMappingURL=getAnalyticsEvent.js.map
@@ -1,4 +1,5 @@
1
+ import { ChannelType } from '../types';
1
2
  /**
2
3
  * @internal
3
4
  */
4
- export declare const getChannelType: () => "IN_APP" | "APNS" | "APNS_SANDBOX" | "GCM" | undefined;
5
+ export declare const getChannelType: () => ChannelType;
@@ -19,4 +19,3 @@ export const getChannelType = () => {
19
19
  }
20
20
  throw new PlatformNotSupportedError();
21
21
  };
22
- //# sourceMappingURL=getChannelType.js.map
@@ -1,3 +1,4 @@
1
1
  export { createMessageEventRecorder } from './createMessageEventRecorder';
2
+ export { getAnalyticsEvent } from './getAnalyticsEvent';
2
3
  export { getChannelType } from './getChannelType';
3
- export { getPushNotificationUserAgentString } from './getPushNotificationUserAgentString';
4
+ export { resolveConfig } from './resolveConfig';
@@ -1,6 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  export { createMessageEventRecorder } from './createMessageEventRecorder';
4
+ export { getAnalyticsEvent } from './getAnalyticsEvent';
4
5
  export { getChannelType } from './getChannelType';
5
- export { getPushNotificationUserAgentString } from './getPushNotificationUserAgentString';
6
- //# sourceMappingURL=index.js.map
6
+ export { resolveConfig } from './resolveConfig';
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { Amplify } from '@aws-amplify/core';
4
- import { assert, PushNotificationValidationErrorCode } from '../errors';
4
+ import { assert, PushNotificationValidationErrorCode } from '../../../errors';
5
5
  /**
6
6
  * @internal
7
7
  */
@@ -11,4 +11,3 @@ export const resolveConfig = () => {
11
11
  assert(!!region, PushNotificationValidationErrorCode.NoRegion);
12
12
  return { appId, region };
13
13
  };
14
- //# sourceMappingURL=resolveConfig.js.map
@@ -4,4 +4,3 @@ export var PushNotificationErrorCode;
4
4
  (function (PushNotificationErrorCode) {
5
5
  PushNotificationErrorCode["NotInitialized"] = "NotInitialized";
6
6
  })(PushNotificationErrorCode || (PushNotificationErrorCode = {}));
7
- //# sourceMappingURL=errors.js.map
@@ -1,4 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  export * from './errors';
4
- //# sourceMappingURL=index.js.map
4
+ export * from './inputs';
5
+ export * from './options';
6
+ export * from './outputs';
7
+ export * from './pushNotifications';
@@ -1,7 +1,7 @@
1
1
  import { UserProfile } from '@aws-amplify/core';
2
2
  import { PushNotificationServiceOptions } from './options';
3
3
  import { OnPushNotificationMessageHandler, OnTokenReceivedHandler, PushNotificationPermissions } from './pushNotifications';
4
- export declare type PushNotificationIdentifyUserInput<ServiceOptions extends PushNotificationServiceOptions = PushNotificationServiceOptions> = {
4
+ export type PushNotificationIdentifyUserInput<ServiceOptions extends PushNotificationServiceOptions = PushNotificationServiceOptions> = {
5
5
  /**
6
6
  * A User ID associated to the current device.
7
7
  */
@@ -15,9 +15,9 @@ export declare type PushNotificationIdentifyUserInput<ServiceOptions extends Pus
15
15
  */
16
16
  options?: ServiceOptions;
17
17
  };
18
- export declare type PushNotificationRequestPermissionsInput = PushNotificationPermissions;
19
- export declare type PushNotificationSetBadgeCountInput = number;
20
- export declare type PushNotificationOnNotificationOpenedInput = OnPushNotificationMessageHandler;
21
- export declare type PushNotificationOnNotificationReceivedInBackgroundInput = OnPushNotificationMessageHandler;
22
- export declare type PushNotificationOnNotificationReceivedInForegroundInput = OnPushNotificationMessageHandler;
23
- export declare type PushNotificationOnTokenReceivedInput = OnTokenReceivedHandler;
18
+ export type PushNotificationRequestPermissionsInput = PushNotificationPermissions;
19
+ export type PushNotificationSetBadgeCountInput = number;
20
+ export type PushNotificationOnNotificationOpenedInput = OnPushNotificationMessageHandler;
21
+ export type PushNotificationOnNotificationReceivedInBackgroundInput = OnPushNotificationMessageHandler;
22
+ export type PushNotificationOnNotificationReceivedInForegroundInput = OnPushNotificationMessageHandler;
23
+ export type PushNotificationOnTokenReceivedInput = OnTokenReceivedHandler;
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- //# sourceMappingURL=inputs.js.map
3
+ export {};
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Base type for service options.
3
3
  */
4
- export declare type PushNotificationServiceOptions = Record<string, unknown>;
4
+ export type PushNotificationServiceOptions = Record<string, unknown>;
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- //# sourceMappingURL=options.js.map
3
+ export {};
@@ -1,10 +1,10 @@
1
1
  import { EventListenerRemover } from '../../eventListeners';
2
2
  import { PushNotificationMessage, PushNotificationPermissionStatus } from '../types';
3
- export declare type PushNotificationGetBadgeCountOutput = number | null;
4
- export declare type PushNotificationGetLaunchNotificationOutput = PushNotificationMessage | null;
5
- export declare type PushNotificationGetPermissionStatusOutput = PushNotificationPermissionStatus;
6
- export declare type PushNotificationRequestPermissionsOutput = boolean;
7
- export declare type PushNotificationOnNotificationOpenedOutput = EventListenerRemover;
8
- export declare type PushNotificationOnNotificationReceivedInBackgroundOutput = EventListenerRemover;
9
- export declare type PushNotificationOnNotificationReceivedInForegroundOutput = EventListenerRemover;
10
- export declare type PushNotificationOnTokenReceivedOutput = EventListenerRemover;
3
+ export type PushNotificationGetBadgeCountOutput = number | null;
4
+ export type PushNotificationGetLaunchNotificationOutput = PushNotificationMessage | null;
5
+ export type PushNotificationGetPermissionStatusOutput = PushNotificationPermissionStatus;
6
+ export type PushNotificationRequestPermissionsOutput = boolean;
7
+ export type PushNotificationOnNotificationOpenedOutput = EventListenerRemover;
8
+ export type PushNotificationOnNotificationReceivedInBackgroundOutput = EventListenerRemover;
9
+ export type PushNotificationOnNotificationReceivedInForegroundOutput = EventListenerRemover;
10
+ export type PushNotificationOnTokenReceivedOutput = EventListenerRemover;
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- //# sourceMappingURL=outputs.js.map
3
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { PushNotificationMessage } from '@aws-amplify/react-native';
2
2
  export type { PushNotificationMessage, PushNotificationPermissionStatus, PushNotificationPermissions, } from '@aws-amplify/react-native';
3
- export declare type OnTokenReceivedHandler = (token: string) => void;
4
- export declare type OnPushNotificationMessageHandler = (message: PushNotificationMessage) => void;
5
- export declare type PushNotificationEvent = 'backgroundMessageReceived' | 'foregroundMessageReceived' | 'launchNotificationsOpened' | 'notificationOpened' | 'tokenReceived';
3
+ export type OnTokenReceivedHandler = (token: string) => void;
4
+ export type OnPushNotificationMessageHandler = (message: PushNotificationMessage) => void;
5
+ export type PushNotificationEvent = 'backgroundMessageReceived' | 'foregroundMessageReceived' | 'launchNotificationOpened' | 'notificationOpened' | 'tokenReceived';
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- //# sourceMappingURL=pushNotifications.js.map
3
+ export {};
@@ -5,4 +5,3 @@ export const getPushNotificationUserAgentString = (action) => getAmplifyUserAgen
5
5
  category: Category.PushNotification,
6
6
  action,
7
7
  });
8
- //# sourceMappingURL=getPushNotificationUserAgentString.js.map
@@ -1,4 +1,4 @@
1
+ export { getPushNotificationUserAgentString } from './getPushNotificationUserAgentString';
1
2
  export { initialize, isInitialized } from './initializationManager';
2
- export { resolveConfig } from './resolveConfig';
3
3
  export { resolveCredentials } from './resolveCredentials';
4
4
  export { getToken, setToken } from './tokenManager';
@@ -1,7 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
+ export { getPushNotificationUserAgentString } from './getPushNotificationUserAgentString';
3
4
  export { initialize, isInitialized } from './initializationManager';
4
- export { resolveConfig } from './resolveConfig';
5
5
  export { resolveCredentials } from './resolveCredentials';
6
6
  export { getToken, setToken } from './tokenManager';
7
- //# sourceMappingURL=index.js.map
@@ -15,4 +15,3 @@ export const initialize = async () => {
15
15
  * @internal
16
16
  */
17
17
  export const isInitialized = () => initialized;
18
- //# sourceMappingURL=initializationManager.js.map
@@ -10,4 +10,3 @@ export const resolveCredentials = async () => {
10
10
  assert(!!credentials, PushNotificationValidationErrorCode.NoCredentials);
11
11
  return { credentials, identityId };
12
12
  };
13
- //# sourceMappingURL=resolveCredentials.js.map
@@ -15,4 +15,3 @@ export const setToken = (newToken) => {
15
15
  * @internal
16
16
  */
17
17
  export const getToken = () => token;
18
- //# sourceMappingURL=tokenManager.js.map