Skip to content

Commit

Permalink
Merge pull request #52 from shankari/master
Browse files Browse the repository at this point in the history
Construct all the server call URLs using string concatenation
  • Loading branch information
shankari authored May 29, 2022
2 parents 7697415 + 4f9253c commit 71ca9ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 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-serversync"
version="1.2.8">
version="1.2.9">

<name>ServerSync</name>
<description>Push and pull local data to the server</description>
Expand Down
10 changes: 4 additions & 6 deletions src/ios/BEMServerSyncCommunicationHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ +(void)phone_to_server:(NSArray *)entriesToPush completionHandler:(void (^)(NSDa
NSMutableDictionary *toPush = [[NSMutableDictionary alloc] init];
[toPush setObject:entriesToPush forKey:@"phone_to_server"];

NSURL* kBaseURL = [[ConnectionSettings sharedInstance] getConnectUrl];
NSURL* kUsercachePutURL = [NSURL URLWithString:kUsercachePutPath
relativeToURL:kBaseURL];
NSString* kBaseURLString = [[ConnectionSettings sharedInstance] getConnectString];
NSURL* kUsercachePutURL = [NSURL URLWithString:[kBaseURLString stringByAppendingString:kUsercachePutPath]];

CommunicationHelper *executor = [[CommunicationHelper alloc] initPost:kUsercachePutURL data:toPush completionHandler:completionHandler];
[executor execute];
Expand Down Expand Up @@ -214,9 +213,8 @@ + (NSInteger)fetchedData:(NSData *)responseData {
+(void)server_to_phone:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler {
NSLog(@"CommunicationHelper.server_to_phone called!");
NSMutableDictionary *blankDict = [[NSMutableDictionary alloc] init];
NSURL* kBaseURL = [[ConnectionSettings sharedInstance] getConnectUrl];
NSURL* kUsercacheGetURL = [NSURL URLWithString:kUsercacheGetPath
relativeToURL:kBaseURL];
NSString* kBaseURLString = [[ConnectionSettings sharedInstance] getConnectString];
NSURL* kUsercacheGetURL = [NSURL URLWithString:[kBaseURLString stringByAppendingString:kUsercacheGetPath]];
CommunicationHelper *executor = [[CommunicationHelper alloc] initPost:kUsercacheGetURL data:blankDict completionHandler:completionHandler];
[executor execute];
}
Expand Down

0 comments on commit 71ca9ba

Please sign in to comment.