Closed maya-salcedo closed 4 months ago
Hello, could you send logs while using your correct App Key please? It would help, thanks Otherwise the first error displayed is the request to get a channel ID being unauthorized
Hello @Apekka, I used my correct App Key when getting the logs. I just replaced it with "myapp_appKey" placeholder in here so I don't have to share it publicly here.
@maya-salcedo Thank you for the heads up.
Sadly I couldn't replicate your issue, the 401 API Error is caused by your appKey/appSecret being incorrect or missing, could you double check if they match please?
@Apekka Yes I checked several times that my appKey and AppSecret are correct. If I deliberately initialize the Airship using a random string for appKey:
await Airship.takeOff({
enabledFeatures: [],
development: {
appKey: 'this-is-a-random-number',
appSecret: 'myapp_appSecret',
logLevel: 'verbose',
ios: {
logPrivacyLevel: 'public',
},
},
site: 'eu',
urlAllowList: ['*'],
});
This is the log that I get
[E] AirshipKit/Config.swift validate(logIssues:) [Line 617] Current App Key is not valid.
[E] AirshipKit/Config.swift validate(logIssues:) [Line 624] Current App Secret is not valid.
.....
[E] AirshipKit/Config.swift validate(logIssues:) [Line 617] Current App Key this-is-a-random-number is not valid.
Similar logs for a deliberately wrong app secret value
await Airship.takeOff({
enabledFeatures: [],
development: {
appKey: 'myapp_appKey',
appSecret: 'random-string-for-app-secret',
logLevel: 'verbose',
ios: {
logPrivacyLevel: 'public',
},
},
site: 'eu',
urlAllowList: ['*'],
});
The log:
[E] AirshipKit/Config.swift validate(logIssues:) [Line 617] Current App Key is not valid.
[E] AirshipKit/Config.swift validate(logIssues:) [Line 624] Current App Secret is not valid.
...
[E] AirshipKit/Config.swift validate(logIssues:) [Line 624] Current App Secret random-string-for-app-secret is not valid.
The SDK would not be initialised at all if I have incorrect app secret or app key values. I would not get a registration token at all.
That check is just checking the shape of the app key and secret. Sometimes customers use the master secret instead of the app secret. The other thing is to make sure the site is correct, if you are using https://go.airship.eu/ its eu, if not its us.
The last thing to note here is it may take an additional app run to switch config, so make sure you run it twice or a new install when modifying the config.
Thanks a lot @rlepinski! It is indeed the wrong config value for the site. The channel id is now available after switching to site: 'us'
.
Glad its working :)
❗For how-to inquiries involving Airship functionality or use cases, please contact (support)[https://support.airship.com/].
Preliminary Info
What Airship dependencies are you using?
"@ua/react-native-airship": "19.0.0",
What are the versions of any relevant development tools you are using?
Report
What unexpected behavior are you seeing?
On iOS, calling takeOff on the App.tsx file with the app secret and keys in the config never generates channel Id.
Turn on push notification feature,
I have waited at least 10 minutes or more, but this listener never got triggered.
or even fetching it after registration token is created,
await Airship.channel.getChannelId();
endpoint returns undefined.What is the expected behavior?
Channel Id should be available, not immediately, but should be available later at least.
What are the steps to reproduce the unexpected behavior?
Do you have logging for the issue?