'No APNS token specified' error getting token on iOS
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 28/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- firebase, ios, typescript
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
Bắt đầu bằng cách lần theo các lệnh gọi firebase().messaging().registerDeviceForRemoteMessages() và getToken() trong flow firebaseInitialization đã được báo cáo, sử dụng thiết lập GoogleService-Info.plist và app.entitlements được tài liệu hóa làm ngữ cảnh. Kiểm tra vì sao isDeviceRegisteredForRemoteMessages vẫn là false trên iOS. Hoàn thành khi việc đăng ký thiết bị thành công và getToken() trả về một FCM token mà không có lỗi APNS-token.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I have an issue using this plugin on iOS. I receive this error when trying to get Firebase token:
No APNS token specified before fetching FCM Token
I put GoogleService-Info.plist and app.entitlements in app/App_Resources/iOS as described in the documentation
I tried both with xcode 14.3.1 and 15.0-beta
these are the dependencies in package.json:
@nativescript/ios: 8.5.2
@nativescript/types: 8.5.0
@nativescript/core: 8.5.5
@nativescript/firebase-core: 3.1.0
@nativescript/firebase-messaging: 3.1.0
And this is the function called when the application is started:
async function firebaseInitialization() {
console.log("firebaseInitialization: start firebase registering");
const defaultApp = await firebase().initializeApp();
console.log("firebase initialized");
console.log("request for permission");
const enabled = await requestUserPermission()
try {
if (enabled) {
firebase().messaging().showNotificationsWhenInForeground = true
console.log("trying to get current token")
const token = await firebase().messaging().getToken()
console.log("current token: " + token)
//rest of the code
...
}
} catch (e) {
console.log("ERROR: " + e) //<-- the error is catched here
}
}
async function requestUserPermission() {
const authStatus = await firebase()
.messaging()
.requestPermission({
ios: {
alert: true,
},
});
const enabled = authStatus === AuthorizationStatus.AUTHORIZED || authStatus === AuthorizationStatus.PROVISIONAL;
if (enabled) {
console.log('Push notification authorized')
const didRegister = await firebase().messaging()
.registerDeviceForRemoteMessages();
return true
} else {
console.log('Push notification NOT authorized')
return false
}
}
This is the console output:
firbaseInitialization: start firebase registering
firebase initialized
request for permission
Push notification authorized
trying to get current token
ERROR: Error: No APNS token specified before fetching FCM Token
I seem to have done everything that is requested in the documentation. Any idea?
EDIT:
I tried to wrap the registerDeviceForRemoteMessages call in a try-catch statement. No exception is thrown, but after that, the registration status, checked with firebase().messaging().isDeviceRegisteredForRemoteMessages, is false
- Ngôn ngữ chính
- TypeScript
- Star
- 62
- Fork
- 53
- Merge trung bình
- 8 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NativeScript/firebase
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
NativeScript/firebase#292 ·
-
Can't install package Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
NativeScript/firebase#289 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
NativeScript/firebase#288 · 4 reaction ·
-
bug ios
NativeScript/firebase#287 · 1 người được giao ·
-
Uh-Oh Shazam Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
NativeScript/firebase#286 ·
Tất cả issue của NativeScript/firebase
Issue tương tự
-
blocklist removal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
pastelsky/bundlephobia#1122 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100