Closed abhayastudios closed 6 years ago
I don't know if that's related but updating the entitlements file manually broke my builds too. In my case that happened because I did use the personal team in Xcode for automatic certificate management. Personal certificates don't support the entitlement you need for Dynamic Links to work. If this could be your problem too here's the solution:
Revert the entitlements file. Update your DEVELOPMENT_TEAM
in the app/App_Resources/iOS/build.xcconfig
file. Run tns platform clean ios
and tns build ios
. Then open the project with Xcode and add the entitlement using Xcode. The certificate manager should resolve any certificate issues you might have had automatically.
@hettiger I already have my DEVELOPMENT_TEAM
properly set (i.e. not the Personal Team) in my app/App_Resources/iOS/build.xcconfig
.
Also when I go in Xcode to capabilities, I correctly see the Associated Domains part filled with the correct applinks
reference to the google domain, so I don't think that is the issue in my case.
Thanks for your comment anyway!
@abhayastudios Try tns plugin remove nativescript-plugin-firebase
then make sure your firebase.nativescript.json
enables the invites feature:
{
"using_ios": true,
...
"invites": true
}
Once you saved that file you can do tns plugin install nativescript-plugin-firebase
. Now make sure to tns platform clean ios
before you try to run the app again. Does this fix the crashing? If not: Where do you execute the firebase.init
function? Did you wrap it into a timeout / ngZone?
Hey @hettiger, I tried all kinds of variants of removing/adding the plugin & platform and re-running npm run config
from the plugin dir.
Regarding the firebase.init
: all the other features were working just fine before I enabled the Invites feature (and continue to work fine once I disable it). I am running the init from my main.ts
and tried both with and without the setTimeout
:
setTimeout(() => { firebase.init({
// Optionally pass in properties for database, authentication and cloud messaging, see their respective docs.
iOSEmulatorFlush: false, // flush token before init due to Firebase bug with iOS simulator
storageBucket: 'gs://<app code>.appspot.com/',
onMessageReceivedCallback: (message: firebase.Message) => {
console.log(`Title: ${message.title}`);
console.log(`Body: ${message.body}`);
}
}).then(
(instance) => {
console.log("firebase.init done");
},
(error) => {
console.log("firebase.init error: " + error);
}
);
},100);
@abhayastudios Try this: Implement the AfterViewInit
on your AppComponent
and from there you execute firebase.init
wrapped inside a ngZone.run
and setTimeout
of 0 like this:
ngAfterViewInit(): void {
this.ngZone.run(() => {
setTimeout(() => {
// firebase.init() goes here...
}, 0);
});
}
This is what's working for me. Maybe it helps.
I appreciate your advice, but unfortunately, none of these work for me... I am hoping there is someone here that better understands the crash log above to pinpoint to the issue.
Thanks again!
@abhayastudios I wish I could’ve been of more help for you but at least I can tell you that it is working for me on both android and iOS so keep on trying. Maybe it is something specific to your project. Interferences with some plug-ins for example.
I just had another go at it and it turns out I had an issue in the way I had structured CFBundleURLTypes
my Info.plist. After copying the structure from the demo project it started to work (I don't know why I didn't think of that before).
Anyway, good times :)
I'm having the same issue. Tried the exact same steps as you, but still having the same problem. Can we get any kind of clarification about the mapping between the Firebase supplied GoogleService-Info.plist, the Info.plist, and the firebase.nativescript.json?
I understand the firebase.nativescript.json ultimately tells nativescript which pods to install in the platforms/ios, but I'm finding that this issue is somehow related to having one or more of these files slightly misconfigured.
Hi everyone,
Having an issue on iOS (both real device and simulator both running iOS11) and
nativescript-plugin-firebase
v5.1.7, where the app crashes during boot (even if I disablefirebase.init
).The issue started to occur immediately after I enabled the invites feature and as far as I can tell I have followed the instructions literally (other features such as Storage, Firestore, Messaging, Facebook Auth work just fine).
The Xcode crash log (see full log below) states
Thread 0 crashed
but I am not familiar enough with iOS to make out what triggered it.Anyone able to tell what I might be missing?
Addition to Info.plist:
I also have set the key to access the contacts:
testapp.entitlements
:NativeScript versions
Xcode device crash log: