You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.4 KiB

5 years ago
  1. /*
  2. * Copyright 2019 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <FirebaseInstanceID/FIRInstanceID.h>
  17. #import <FirebaseInstanceID/FIRInstanceIDCheckinPreferences.h>
  18. /**
  19. * @related FIRInstanceIDCheckinService
  20. *
  21. * The completion handler invoked once the fetch from Checkin server finishes.
  22. * For successful fetches we returned checkin information by the checkin service
  23. * and `nil` error, else we return the appropriate error object as reported by the
  24. * Checkin Service.
  25. *
  26. * @param checkinPreferences The checkin preferences as fetched from the server.
  27. * @param error The error object which fetching GServices data.
  28. */
  29. typedef void (^FIRInstanceIDDeviceCheckinCompletion)(
  30. FIRInstanceIDCheckinPreferences *_Nullable checkinPreferences, NSError *_Nullable error);
  31. /**
  32. * Private API used by Firebase SDK teams by calling in reflection or internal teams.
  33. */
  34. @interface FIRInstanceID (Private)
  35. /**
  36. * Fetches checkin info for the app. If the app has valid cached checkin preferences
  37. * they are returned instead of making a network request.
  38. *
  39. * @param handler The completion handler to invoke once the request has completed.
  40. */
  41. - (void)fetchCheckinInfoWithHandler:(nullable FIRInstanceIDDeviceCheckinCompletion)handler;
  42. /**
  43. * Get the InstanceID for the app. If an ID was created before and cached
  44. * successfully we will return that ID. If no cached ID exists we create
  45. * a new ID, cache it and return that.
  46. *
  47. * This is a blocking call and should not really be called on the main thread.
  48. *
  49. * @param error The error object that represents the error while trying to
  50. * retrieve the instance id.
  51. *
  52. * @return The InstanceID for the app.
  53. */
  54. - (nullable NSString *)appInstanceID:(NSError *_Nullable *_Nullable)error
  55. DEPRECATED_MSG_ATTRIBUTE("Please use getID(handler:) for Swift or "
  56. "getIDWithHandler: for Objective-C instead.");
  57. @end