FIRFunctions+Internal.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2017 Google
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <Foundation/Foundation.h>
  15. #import "FIRFunctions.h"
  16. @class FIRHTTPSCallableResult;
  17. NS_ASSUME_NONNULL_BEGIN
  18. @interface FIRFunctions (Internal)
  19. /**
  20. * Calls an http trigger endpoint.
  21. * @param name The name of the http trigger.
  22. * @param data Parameters to pass to the function. Can be anything encodable as JSON.
  23. * @param completion The block to call when the request is complete.
  24. */
  25. - (void)callFunction:(NSString *)name
  26. withObject:(nullable id)data
  27. completion:(void (^)(FIRHTTPSCallableResult *_Nullable result,
  28. NSError *_Nullable error))completion;
  29. /**
  30. * Constructs the url for an http trigger. This is exposed only for testing.
  31. * @param name The name of the endpoint.
  32. */
  33. - (NSString *)URLWithName:(NSString *)name;
  34. /**
  35. * Sets the functions client to send requests to localhost instead of Firebase.
  36. * For testing only.
  37. */
  38. - (void)useLocalhost;
  39. @end
  40. NS_ASSUME_NONNULL_END