Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document amplifyconfiguration.json format or schema for push notification plugin configuration. #3410

Closed
sungwonshinn opened this issue Dec 8, 2023 · 4 comments
Labels
documentation Documentation improvements push-notifications Issues related to the Push Notifications category question General question

Comments

@sungwonshinn
Copy link

Describe the bug

Amplify doesn't document the AWSPinpointPushNotificationsPlugin configuration in ampliyconfiguration.json. We are using our existing AWS resources and we don't use Amplify CLI to manage resources.
Since the json for push notification plugin is not documented, we can't customize amplifyconfiguration.json. It needs to documented.

Steps To Reproduce

Since this is a defect in the document, there is no repro steps.

If the push plugin configuration is not added, it will throw a configuration error during initialization.

I've added the following, but it crashes the app at PushNotificationCategory.recordNotificationReceived(_:).  So, I assume it is not configured properly.

"notifications": {
        "plugins": {
            "awsPinpointPushNotificationsPlugin": {
                "appId": "xxx",
                "region": "xxx",
                "pinpointTargeting": {
                    "region": "xxx"
                }
            }
        }
    }

Expected behavior

The schema of the push plugin configuration section of amplifyconfiguration.json is documented.

Amplify Framework Version

2.22.0

Amplify Categories

Analytics

Dependency manager

Swift PM

Swift version

5.9

CLI version

No using CLI

Xcode version

15.0.1

Relevant log output

<details>
<summary>Log Messages</summary>


INSERT LOG MESSAGES HERE
```

Is this a regression?

No

Regression additional context

No response

Platforms

iOS

OS Version

iOS 17.1.2

Device

Iphone Pro Max 14

Specific to simulators

No response

Additional context

No response

@atierian atierian added documentation Documentation improvements question General question push-notifications Issues related to the Push Notifications category labels Dec 8, 2023
@atierian
Copy link
Member

atierian commented Dec 8, 2023

Thanks for opening this issue @sungwonshinn
The structure of the amplifyconfiguration.json for notifications is documented under Push Notifications > Set up backend resources > Existing resources tab.

"notifications": {
    "plugins": {
        "awsPinpointPushNotificationsPlugin": {
            "appId": "[APP ID]",
            "region": "[REGION]"
        }
    }
}

What's the error message that you're seeing when configuring the plugin? And what is the crash message you receive when invoking PushNotificationCategory.recordNotificationReceived(_:)

@atierian atierian added the pending-community-response Issue is pending response from the issue requestor label Dec 8, 2023
@sungwonshinn
Copy link
Author

sungwonshinn commented Dec 8, 2023

@atierian Thank you.

What's the error message that you're seeing when configuring the plugin?

I think it will work properly with a notification body in awsconfiguration.json. So, I think it's fine.
PluginError: Unable to decode configuration
Recovery suggestion: Make sure the plugin configuration is JSONValue
▿ pluginConfigurationError : 3 elements
- .0 : "Unable to decode configuration"
- .1 : "Make sure the plugin configuration is JSONValue"

And what is the crash message you receive when invoking PushNotificationCategory.recordNotificationReceived(_:)

It was EXC_BREAKPOINT (SIGTRAP). I have attached the crash report.
amplify push crash.txt

@atierian
Copy link
Member

atierian commented Dec 8, 2023

Great, please let us know when you confirm that it works with the correct configuration. Thanks!

@atierian
Copy link
Member

Closing as this appears to be resolved. If you're still experiencing this, please open a new issue. Thanks!

@github-actions github-actions bot removed the pending-community-response Issue is pending response from the issue requestor label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation improvements push-notifications Issues related to the Push Notifications category question General question
Projects
None yet
Development

No branches or pull requests

2 participants