NativeScript / NativeScript/firebase
initializeApp not working on iOS device
Chưa có ai nhận issue này.
- 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
Mô tả
I'm converting an app from the old @nativescript/firebase library, and this is just about complete and fully functional on Android. I just tried running this on iOS, and the app is not initializing properly. In looking through firebase-core/index.ios.js, I've discovered that my initialization request is being added to the launchQueue array, but launchCallback is never being called.
There are no errors shown in the logs, so from what I can see the issue is just that this launchQueue is never being used.
I have the same GoogleService-Info.plist file as before in App_Resources/iOS. These are the relevant parts of the main.js file that's acting as the entry point:
import { firebase } from '@nativescript/firebase-core'
import '@nativescript/firebase-auth';
import '@nativescript/firebase-crashlytics';
import '@nativescript/firebase-analytics';
import '@nativescript/firebase-messaging';
// Initialize Firebase
firebase().initializeApp().then(() => {
console.warn('🔥 Firebase initialized');
}).catch(error => {
console.error('🔥 Firebase initialization error: ', error)
});
If I log to the console right before firebase().initializeApp() on iOS I see the log, but the 'Firebase initialized' log never appears. Adding additional logs in firebase-core/index.ios.js shows me that UIApplication.sharedApplication is null when checked, so the call to initApp is appended to the launchQueue array and then never used.
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.
Hướng nghiên cứu
Bắt đầu với firebase-core/index.ios.js và lệnh gọi initializeApp trong main.js. Theo dõi cách UIApplication.sharedApplication, launchQueue và launchCallback được xử lý trong quá trình khởi động iOS. Hoàn tất khi quá trình khởi tạo hoàn thành trên một thiết bị iOS và các callback thành công hoặc lỗi hiện có được gọi đến; xác minh bằng kịch bản logging đã được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- firebase, ios, typescript
- Lĩnh vực
- mobile-dev
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100