Skip to content

Commit

Permalink
rename(init): rename init function to start (#72)
Browse files Browse the repository at this point in the history
* rename(init): rename init function to setup

* fix(tests): Fixing tests and include headers

* chore(BVTs): change to 13.5 for simulator

* Rename setup to start
  • Loading branch information
mpodwysocki authored Jun 10, 2020
1 parent 67d2b04 commit 79e8ccc
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
NSDictionary *configValues = [NSDictionary dictionaryWithContentsOfFile:path];

NSString *connectionString = [configValues objectForKey:@"connectionString"];
NSString *hubName = [configValues objectForKey:@"hubName"];
NSString *hubName = [configValues objectForKey:@"hubName"] ;

[MSNotificationHub setEnrichmentDelegate: self];
[MSNotificationHub setManagementDelegate: self];
[MSNotificationHub setLifecycleDelegate: self];
[MSNotificationHub initWithConnectionString:connectionString hubName:hubName];
[MSNotificationHub startWithConnectionString:connectionString hubName:hubName];
[MSNotificationHub addTag:@"userAgent:com.example.nhubsample-refresh:1.0"];

return YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MSInstallationEnrichmentD
MSNotificationHub.setEnrichmentDelegate(self)
MSNotificationHub.setManagementDelegate(self)
MSNotificationHub.setLifecycleDelegate(self)
MSNotificationHub.initWithConnectionString(connectionString!, hubName: hubName!)
MSNotificationHub.start(connectionString: connectionString!, hubName: hubName!)
MSNotificationHub.addTag("userAgent:com.example.nhubsample-refresh:1.0")

return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

// TODO: Move to loading from constants file
NSString *const kUserAgentFormat = @"NOTIFICATIONHUBS/%@(api-origin=IosSdkV%@; os=%@; os_version=%@;)";
NSString *const kAPIVersion = @"2017-04";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
* Policy, and Hub Name.
* @param connectionString The connection string
*/
+ (void)initWithConnectionString:(NSString *)connectionString hubName:(NSString *)notificationHubName;
+ (void)startWithConnectionString:(NSString *)connectionString hubName:(NSString *)notificationHubName NS_SWIFT_NAME(start(connectionString:hubName:));

#pragma mark Push Initialization

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ + (void)resetSharedInstance {
sharedInstance = nil;
}

+ (void)initWithConnectionString:(NSString *)connectionString hubName:(NSString *)notificationHubName {
+ (void)startWithConnectionString:(NSString *)connectionString hubName:(NSString *)notificationHubName {
MSInstallationManager *installationManager = [[MSInstallationManager alloc] initWithConnectionString:connectionString
hubName:notificationHubName];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
* Policy, and Hub Name.
* @param connectionString The connection string
*/
+ (void)initWithConnectionString:(NSString *)connectionString hubName:(NSString *)notificationHubName;
+ (void)setupWithConnectionString:(NSString *)connectionString hubName:(NSString *)notificationHubName NS_SWIFT_NAME(setup(connectionString:hubName:));

#pragma mark Push Initialization

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ - (void)setUp {
id notificationCenterMock = OCMClassMock([UNUserNotificationCenter class]);
OCMStub(ClassMethod([notificationCenterMock currentNotificationCenter])).andReturn(nil);

[MSNotificationHub initWithConnectionString:connectionString hubName:hubName];
[MSNotificationHub startWithConnectionString:connectionString hubName:hubName];
}

- (void)testAddTag {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ - (void)setUp {
id notificationCenterMock = OCMClassMock([UNUserNotificationCenter class]);
OCMStub(ClassMethod([notificationCenterMock currentNotificationCenter])).andReturn(nil);

[MSNotificationHub initWithConnectionString:connectionString hubName:hubName];
[MSNotificationHub startWithConnectionString:connectionString hubName:hubName];

key = @"template1";
NSString *tag1 = @"tag1";
Expand Down
2 changes: 1 addition & 1 deletion src/runBVT.command
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rm -rf "WindowsAzureMessaging.framework"
cp -R -L "$ABSPATH/WindowsAzureMessaging/Build/Release-iphonesimulator/WindowsAzureMessaging.framework" "WindowsAzureMessaging.framework" 2>&1 | tee -a "$testLogPath"

echo "******* Build and run BVT *******" 2>&1 | tee -a "$testLogPath"
GHUNIT_CLI=1 xcodebuild -scheme IosSdkTests -destination 'platform=iOS Simulator,name=iPhone 8' -configuration Debug -sdk iphonesimulator13.4 clean build 2>&1 | tee -a "$testLogPath"
GHUNIT_CLI=1 xcodebuild -scheme IosSdkTests -destination 'platform=iOS Simulator,name=iPhone 8' -configuration Debug -sdk iphonesimulator13.5 clean build 2>&1 | tee -a "$testLogPath"

grep "BUILD SUCCEEDED" "$testLogPath" &> /dev/null
if [ "$?" != "0" ]; then
Expand Down

0 comments on commit 79e8ccc

Please sign in to comment.