Skip to content

Instantly share code, notes, and snippets.

@banjun
Created November 8, 2018 03:34
Show Gist options
  • Select an option

  • Save banjun/80e0ccc22bf45a839815f17ff17fb35d to your computer and use it in GitHub Desktop.

Select an option

Save banjun/80e0ccc22bf45a839815f17ff17fb35d to your computer and use it in GitHub Desktop.
silence network comm of firebase to https://device-provisioning.googleapis.com/checkin
final class FakeFirebaseInstanceID: NSObject {
@objc class func instanceID() -> FakeFirebaseInstanceID? { return nil }
static private let once: Void = {
method_exchangeImplementations(
class_getClassMethod(NSClassFromString("FIRInstanceID"), #selector(FakeFirebaseInstanceID.instanceID))!,
class_getClassMethod(FakeFirebaseInstanceID.self, #selector(FakeFirebaseInstanceID.instanceID))!)
}()
static func silenceFirebaseCheckin() {
_ = once
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment