amplify-frontend-android
Advanced tools
Comparing version 3.4.1-upgrade-graphql15-2.0 to 3.5.0-pinpoint-customer-config.0
@@ -6,3 +6,3 @@ # Change Log | ||
## [3.4.1-upgrade-graphql15-2.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-frontend-android@3.4.0...amplify-frontend-android@3.4.1-upgrade-graphql15-2.0) (2023-01-18) | ||
# [3.5.0-pinpoint-customer-config.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-frontend-android@3.4.0...amplify-frontend-android@3.5.0-pinpoint-customer-config.0) (2023-01-24) | ||
@@ -16,5 +16,10 @@ | ||
### Features | ||
* generate analytics/notifications customer config sections ([df75892](https://github.com/aws-amplify/amplify-cli/commit/df75892ccbead85cf56bb1e5efd3cdf6c52df0db)) | ||
# [3.4.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-frontend-android@3.3.3...amplify-frontend-android@3.4.0) (2022-04-11) | ||
@@ -21,0 +26,0 @@ |
@@ -8,2 +8,3 @@ function generateConfig(context, newAWSConfig) { | ||
constructAnalytics(metadata, amplifyConfig); | ||
constructNotifications(metadata, amplifyConfig); | ||
constructApi(metadata, amplifyConfig); | ||
@@ -29,2 +30,33 @@ // Auth plugin with entire awsconfiguration contained required for Native GA release | ||
function constructNotifications(metadata, amplifyConfig) { | ||
// ignore APNS channel as it not supported for iOS frontend | ||
const notificationChannelsMap = { | ||
'SMS': 'awsPinpointSmsNotificationsPlugin', | ||
'EMAIL': 'awsPinpointEmailNotificationsPlugin', | ||
'FCM': 'awsPinpointPushNotificationsPlugin', | ||
'InAppMessaging': 'awsPinpointInAppMessagingNotificationsPlugin', | ||
} | ||
const categoryName = 'notifications'; | ||
if (metadata[categoryName] && Object.keys(metadata[categoryName]).length > 0) { | ||
const r = Object.keys(metadata[categoryName])[0]; // only one resource in analytics | ||
const resourceMeta = metadata[categoryName][r]; | ||
if (resourceMeta.output) { | ||
for (const [channel, plugin] of Object.entries(notificationChannelsMap)) { | ||
const channelOutput = resourceMeta.output[channel]; | ||
if (channelOutput && channelOutput.Enabled) { | ||
amplifyConfig[categoryName] = amplifyConfig[categoryName] ?? {}; | ||
amplifyConfig[categoryName].plugins = amplifyConfig[categoryName].plugins ?? {}; | ||
amplifyConfig[categoryName].plugins[plugin] = {}; | ||
amplifyConfig[categoryName].plugins[plugin] = { | ||
appId: channelOutput.ApplicationId, | ||
region: resourceMeta.output.Region, | ||
}; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
function constructAnalytics(metadata, amplifyConfig) { | ||
@@ -218,3 +250,3 @@ const categoryName = 'analytics'; | ||
} | ||
if(resourceMeta.isDefault === true) { | ||
if (resourceMeta.isDefault === true) { | ||
defaultMap = mapName; | ||
@@ -227,3 +259,3 @@ } | ||
placeIndexConfig.items.push(placeIndexName); | ||
if(resourceMeta.isDefault === true) { | ||
if (resourceMeta.isDefault === true) { | ||
defaultPlaceIndex = placeIndexName; | ||
@@ -230,0 +262,0 @@ } |
@@ -94,4 +94,3 @@ const constants = require('./constants'); | ||
const newAWSConfig = getNewAWSConfigObject(context, amplifyResources, cloudAmplifyResources); | ||
const amplifyConfig = amplifyConfigHelper.generateConfig(context, newAWSConfig); | ||
return amplifyConfig; | ||
return amplifyConfigHelper.generateConfig(context, newAWSConfig); | ||
} | ||
@@ -98,0 +97,0 @@ |
{ | ||
"name": "amplify-frontend-android", | ||
"version": "3.4.1-upgrade-graphql15-2.0", | ||
"version": "3.5.0-pinpoint-customer-config.0", | ||
"description": "amplify-cli front-end plugin for Android project", | ||
@@ -23,3 +23,3 @@ "repository": { | ||
}, | ||
"gitHead": "a9179c71eceb850a395f81e2d3b9623b3eb7663c" | ||
"gitHead": "391eae3e5f654848c00bd457c798a43ec444bbe6" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83469
907