From 27346b5d37e3ddef661f5710a5951096c2ad2ac3 Mon Sep 17 00:00:00 2001 From: Shankari Date: Sat, 28 May 2022 21:35:30 -0700 Subject: [PATCH] Return the connection string instead of the connection URL This allows us to construct relative URLs by appending strings instead of using the relative URL method, which doesn't work if the base URL is a URL as opposed to just a hostname. https://github.com/e-mission/e-mission-docs/issues/732#issuecomment-1140300236 --- plugin.xml | 2 +- src/ios/BEMConnectionSettings.h | 2 +- src/ios/BEMConnectionSettings.m | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin.xml b/plugin.xml index 7a67f91..41a808e 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,7 +1,7 @@ + version="1.2.3"> ConnectionSettings Simple package that stores all the connection settings that need to be configured diff --git a/src/ios/BEMConnectionSettings.h b/src/ios/BEMConnectionSettings.h index 40ee1ca..456fb4c 100644 --- a/src/ios/BEMConnectionSettings.h +++ b/src/ios/BEMConnectionSettings.h @@ -14,7 +14,7 @@ -(NSDictionary*)getSettings; -(NSDictionary*)getDefaultConfig; -(void)setSettings:(NSDictionary*)newConfig; --(NSURL*) getConnectUrl; +-(NSString*) getConnectString; -(NSString*) authMethod; -(NSString*) authValueForKey:(NSString*) key; @end diff --git a/src/ios/BEMConnectionSettings.m b/src/ios/BEMConnectionSettings.m index 8cca28d..8f15651 100644 --- a/src/ios/BEMConnectionSettings.m +++ b/src/ios/BEMConnectionSettings.m @@ -85,7 +85,7 @@ - (NSDictionary*)getDefaultConfig // from the plugin initialize methods before the javascript has the opportunity to set the config // Note that we cannot throw from the constructor instead because then we cannot create the shared instance // and even the javascript cannot set the config -- (NSURL*)getConnectUrl +- (NSString*)getConnectString { if (connSettingDict == NULL) { NSException* notFoundEx = [[NSException alloc] initWithName:@"SettingsNotFound" @@ -94,7 +94,7 @@ - (NSURL*)getConnectUrl @throw notFoundEx; } - return [NSURL URLWithString:[connSettingDict objectForKey: @"connectUrl"]]; + return [connSettingDict objectForKey: @"connectUrl"]; } - (NSDictionary*) nativeAuth