Skip to content

Commit

Permalink
Return the connection string instead of the connection URL
Browse files Browse the repository at this point in the history
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.

e-mission/e-mission-docs#732 (comment)
  • Loading branch information
shankari committed May 29, 2022
1 parent b936f6f commit 27346b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
id="cordova-plugin-em-settings"
version="1.2.2">
version="1.2.3">

<name>ConnectionSettings</name>
<description>Simple package that stores all the connection settings that need to be configured</description>
Expand Down
2 changes: 1 addition & 1 deletion src/ios/BEMConnectionSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
-(NSDictionary*)getSettings;
-(NSDictionary*)getDefaultConfig;
-(void)setSettings:(NSDictionary*)newConfig;
-(NSURL*) getConnectUrl;
-(NSString*) getConnectString;
-(NSString*) authMethod;
-(NSString*) authValueForKey:(NSString*) key;
@end
4 changes: 2 additions & 2 deletions src/ios/BEMConnectionSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -94,7 +94,7 @@ - (NSURL*)getConnectUrl
@throw notFoundEx;
}

return [NSURL URLWithString:[connSettingDict objectForKey: @"connectUrl"]];
return [connSettingDict objectForKey: @"connectUrl"];
}

- (NSDictionary*) nativeAuth
Expand Down

0 comments on commit 27346b5

Please sign in to comment.