Please provide the following:
- SDK Version: 42.0.0
- Platforms(Android/iOS/web/all): Android
- Add the appropriate “Tag” based on what Expo library you have a question on.
This is my code parts
async function registerForPushNotificationsAsync(deviceKey) {
let token;
if (Constants.isDevice) {
const { status: existingStatus } = await Notifications.getPermissionsAsync();
let finalStatus = existingStatus;
if (existingStatus !== 'granted') {
const { status } = await Notifications.requestPermissionsAsync();
finalStatus = status;
}
if (finalStatus !== 'granted') {
alert('Bildirim İzni Alınamadı. Bildirim almak için ayarlardan izin veriniz.');
return;
}
token = (await Notifications.getExpoPushTokenAsync()).data;
let formData = new FormData();
formData.append('secret', "xxxx");
formData.append('device', Platform.OS);
formData.append('token', token);
formData.append('track',deviceKey);
fetch("https://xxxxx/app/plugin/xxxxx/register", {
body: formData,
method: "post"
})
.then(response => response.json())
.then(data => { });
} else {
alert('Fiziksel Cihaz Desteklemektedir.');
}
if (Platform.OS === 'android') {
await Notifications.setNotificationChannelAsync('default', {
name: 'default',
importance: Notifications.AndroidImportance.MAX,
vibrationPattern: [0, 250, 250, 250],
lightColor: '#FF231F7C',
});
}
return token;
}
IOS is working notification permission request is work. But android is not work norification permission request.
how can i do ?