Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: open source FirebaseInstanceID #186

Closed
herrernst opened this issue Aug 10, 2017 · 20 comments · Fixed by #2414
Closed

FR: open source FirebaseInstanceID #186

herrernst opened this issue Aug 10, 2017 · 20 comments · Fixed by #2414

Comments

@herrernst
Copy link

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 8.3
  • Firebase SDK version: 0.0.1
  • Library version: what's the difference?
  • Firebase Product: messaging

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Messaging (and probably some other services) depend on FirebaseInstanceID (which is not open sourced yet). I'm using it like in the Podfile in your examples, locking to an older version of FirebaseInstanceID (which doesn't have dependency on the full closed source Firebase SDK):

# Lock to the 1.0.9 version of InstanceID since 1.0.10 added a dependency
# to FirebaseCore
pod 'FirebaseInstanceID', '1.0.9'

What's the plan for this? Will FirebaseInstanceID open sourced in the near future and integrated into this open source SDK? Thanks.

@rsattar
Copy link
Contributor

rsattar commented Aug 10, 2017

@herrernst This is something we are interested in doing, but unfortunately we currently cannot for various reasons. I can't give a timeline on this, unfortunately!

What's the main desire to see it open-sourced from your end? Just curious. Thanks for the FR!

@herrernst
Copy link
Author

herrernst commented Aug 11, 2017

Thanks for your answer.

What's the main desire to see it open-sourced from your end?

The generic reasons why to prefer open source over closed source: trust (I would like to see the code I include in my app to know what it does) and potential better debugging when there would be a problem.
I can live with it for now, only hope that the old 1.0.9 version of FirebaseInstanceID will not stop working anytime soon ;-) (One problem could arise when Apple introduces a new architecture.)

@rsattar
Copy link
Contributor

rsattar commented Aug 11, 2017

Thanks for the response @herrernst! Your reasons make perfect sense, and that's why we've been open-sourcing our SDKs. The InstanceID SDK will have newer versions that will continue to work, though it will remain closed-source for now. The locking of the version to 1.0.9 was temporarily, will be fixed soon.

@gregbzh
Copy link

gregbzh commented Nov 2, 2017

Hello, I am currently porting Messaging on macOS. Since Messaging is using FirebaseInstanceID, and is currently only available for iOS, it could be nice to make it open source so we can use it also for macOS. If open source is not possible, maybe source code is already macOS compatible and only pod spec must be updated including osx support. Best.

@herrernst
Copy link
Author

Any update on this? FirebaseInstanceID 2.0.3 removed the dependency on FirebaseCore, but 2.0.8 added it again. Any reason why?

@paulb777
Copy link
Member

paulb777 commented Apr 5, 2018

FirebaseInstanceID added dependencies to FirebaseCore for logging.

It's still the plan to open source FirebaseInstanceID but I can't give an update on timing.

@junwchina
Copy link

how dose FirebaseInstanceID get user's local timezone? We deliver FCM message to users in local timezone on firebase console, but some of users receive notification at a wrong timezone. @paulb777

@charlotteliang
Copy link
Contributor

InstanceID use the [NSTimeZone localTimeZone] to get local timezone.

@junwchina
Copy link

got it. Thanks

@paulb777 paulb777 added this to the M44 milestone Feb 20, 2019
@herrernst
Copy link
Author

Thanks for your effort! But when installing Firebase 5.18.0 with (the now open source) FirebaseInstanceID 3.6.0 via CocoaPods, I still get the precompiled framework binary without source (in contrast to e.g. FirebaseCore or FirebaseMessaging, where I get lots of *.m files). Am I expecting something wrong?

screenshot 2019-03-07 at 11 00 20

@paulb777
Copy link
Member

paulb777 commented Mar 7, 2019

@herrernst Thanks for the report! We've reproduced and discovered a glitch in the release process and are hoping to get the right version out ASAP.

@herrernst
Copy link
Author

@paulb777 Thank you!

@paulb777
Copy link
Member

paulb777 commented Mar 7, 2019

FirebaseInstanceID 3.7.0 is now available. Thanks @herrernst for the report!

You may need to run pod deintegrate or rm -rf Pods before running pod update.

@herrernst
Copy link
Author

@paulb777 Thanks again. Source is now installed. Unfortunately, I have another problem. Something is broken when having "use_frameworks!" in the Podfile, my app crashes with "+[FIRInstanceIDCheckinPreferences preferencesFromKeychainContents:]: unrecognized selector sent to class 0x10f92f998".

It's reproducible in a fresh project:

  • Create new Objective-C Single View App, close project
  • pod init, add "pod 'FirebaseMessaging'" and uncomment "use_frameworks!", execute pod install
  • Open workspace, add suitable GoogleService-Info.plist
  • In app delegate:
#import <FirebaseCore/FirebaseCore.h>
#import <FirebaseMessaging/FirebaseMessaging.h>

and

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [FIRApp configure];
    NSLog(@"token: %@", [FIRMessaging messaging].APNSToken); // needed to trigger crash
    return YES;
}

@paulb777
Copy link
Member

paulb777 commented Mar 8, 2019

@herrernst I'm not able to reproduce. Maybe there is some stale build state? Are you able to see the crash in the Xcode debugger?

@herrernst
Copy link
Author

I've cleaned the project, still:
Screenshot 2019-03-13 at 16 34 58

@herrernst
Copy link
Author

Example project attached.
TestFirebaseBuild.zip

@paulb777
Copy link
Member

@herrernst The unrecognized selector issue doesn't reproduce with CocoaPods 1.6.1. I reproduced it with CocoaPods 1.5.3 and worked around it there by adding -ObjC to the Other Linker Flags Build Setting.

@herrernst
Copy link
Author

@paulb777 Thanks for your help, after upgrading CocoaPods it's working now!!

@jkmathew

This comment has been minimized.

@firebase firebase locked and limited conversation to collaborators Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants