diff --git a/cmake/firebase_unity_version.cmake b/cmake/firebase_unity_version.cmake
index 5f03fbb11..731c906c7 100644
--- a/cmake/firebase_unity_version.cmake
+++ b/cmake/firebase_unity_version.cmake
@@ -27,7 +27,7 @@ set(FIREBASE_UNITY_JAR_RESOLVER_VERSION "1.2.171"
)
# https://github.com/firebase/firebase-cpp-sdk
-set(FIREBASE_CPP_SDK_PRESET_VERSION "origin/unity-v9.0.0"
+set(FIREBASE_CPP_SDK_PRESET_VERSION "a192efbda2c22d5c336db00999ac919eb22e5157"
CACHE STRING
"Version tag of Firebase CPP SDK to download (if no local or not passed in) and use (no trailing .0)"
)
diff --git a/docs/readme.md b/docs/readme.md
index 7a96a860d..769f24da7 100644
--- a/docs/readme.md
+++ b/docs/readme.md
@@ -158,6 +158,8 @@ Release Notes
### Upcoming
- Changes
- General: Added a missing namespace to the Google.MiniJson.dll.
+ - Functions: Add a new method `GetHttpsCallableFromURL`, to create callables
+ with URLs other than cloudfunctions.net.
### 9.0.0
- Changes
diff --git a/functions/src/FirebaseFunctions.cs b/functions/src/FirebaseFunctions.cs
index 7dcf6b000..3424e3c27 100644
--- a/functions/src/FirebaseFunctions.cs
+++ b/functions/src/FirebaseFunctions.cs
@@ -212,15 +212,29 @@ private void ThrowIfNull() {
}
///
- /// Creates a
- ///
- /// given a name.
+ /// Creates a given a name.
///
public HttpsCallableReference GetHttpsCallable(string name) {
ThrowIfNull();
return new HttpsCallableReference(this, functionsInternal.GetHttpsCallable(name));
}
+ ///
+ /// Creates a given a URL.
+ ///
+ public HttpsCallableReference GetHttpsCallableFromURL(string url) {
+ ThrowIfNull();
+ return new HttpsCallableReference(this, functionsInternal.GetHttpsCallableFromURL(url));
+ }
+
+ ///
+ /// Creates a given a URL.
+ ///
+ public HttpsCallableReference GetHttpsCallableFromURL(Uri url) {
+ ThrowIfNull();
+ return GetHttpsCallableFromURL(url.ToString());
+ }
+
///
/// Sets an origin of a Cloud Functions Emulator instance to use.
///
diff --git a/functions/testapp/Assets/Firebase/Sample/Functions/TestCase.cs b/functions/testapp/Assets/Firebase/Sample/Functions/TestCase.cs
index 29c61aafb..ddcaa26a0 100644
--- a/functions/testapp/Assets/Firebase/Sample/Functions/TestCase.cs
+++ b/functions/testapp/Assets/Firebase/Sample/Functions/TestCase.cs
@@ -40,10 +40,16 @@ public TestCase(string name, object input, object expectedResult,
ExpectedError = expectedError;
}
+ // Returns the CallableReference to be used by the test. Overridable to allow
+ // different ways to generate the CallableReference.
+ public virtual HttpsCallableReference GetReference(FirebaseFunctions functions) {
+ return functions.GetHttpsCallable(Name);
+ }
+
// Runs the given test and returns whether it passed.
public Task RunAsync(FirebaseFunctions functions,
Utils.Reporter reporter) {
- var func = functions.GetHttpsCallable(Name);
+ var func = GetReference(functions);
return func.CallAsync(Input).ContinueWithOnMainThread((task) => {
if (ExpectedError == FunctionsErrorCode.None) {
// We expected no error.
@@ -82,4 +88,21 @@ public Task RunAsync(FirebaseFunctions functions,
});
}
}
+
+ // TestCase that uses a URL to call the function directly.
+ public class TestCaseWithURL : TestCase {
+ // The URL of the function to call
+ System.Uri URL { get; set; }
+
+ public TestCaseWithURL(string name, System.Uri url, object input, object expectedResult,
+ FunctionsErrorCode expectedError = FunctionsErrorCode.None)
+ : base(name, input, expectedResult, expectedError) {
+ URL = url;
+ }
+
+ // Generate the CallableReference using the URL
+ public override HttpsCallableReference GetReference(FirebaseFunctions functions) {
+ return functions.GetHttpsCallableFromURL(URL);
+ }
+ }
}
diff --git a/functions/testapp/Assets/Firebase/Sample/Functions/UIHandlerAutomated.cs b/functions/testapp/Assets/Firebase/Sample/Functions/UIHandlerAutomated.cs
index b3c918196..f4b377231 100644
--- a/functions/testapp/Assets/Firebase/Sample/Functions/UIHandlerAutomated.cs
+++ b/functions/testapp/Assets/Firebase/Sample/Functions/UIHandlerAutomated.cs
@@ -54,6 +54,12 @@ public static IEnumerable AllTests() {
FunctionsErrorCode.Internal);
yield return new TestCase("explicitErrorTest", null, null,
FunctionsErrorCode.OutOfRange);
+
+ // Test calling via Url
+ string projectId = FirebaseApp.DefaultInstance.Options.ProjectId;
+ yield return new TestCaseWithURL("scalarTest via Url",
+ new System.Uri("https://us-central1-" + projectId + ".cloudfunctions.net/scalarTest"),
+ 17, 76L);
}
protected override void Start() {