Change the mention of Sonar in iOS sample app

Summary: Update the iOS sample app with flipper

Reviewed By: passy

Differential Revision: D9056882

fbshipit-source-id: f5b49fc60905c6d5ebca3da977cf966e76feffb8
This commit is contained in:
Pritesh Nandgaonkar
2018-07-31 10:27:47 -07:00
committed by Pascal Hartig
parent 07d75ce848
commit 10dc4d0ca9
6 changed files with 13 additions and 13 deletions

View File

@@ -48,7 +48,7 @@
[_window setRootViewController: [[UINavigationController alloc] initWithRootViewController: mainViewController]]; [_window setRootViewController: [[UINavigationController alloc] initWithRootViewController: mainViewController]];
[_window makeKeyAndVisible]; [_window makeKeyAndVisible];
NSLog(@"Hello from Sonar in an Objc app!"); NSLog(@"Hello from Flipper in an Objc app!");
return YES; return YES;
} }

View File

@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.facebook.sonar</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>

View File

@@ -29,12 +29,12 @@
} }
- (IBAction)tappedPOSTAPI:(UIButton *)sender { - (IBAction)tappedPOSTAPI:(UIButton *)sender {
NSString *post = @"https://demo9512366.mockable.io/SonarPost"; NSString *post = @"https://demo9512366.mockable.io/FlipperPost";
NSURL *url = [NSURL URLWithString:post]; NSURL *url = [NSURL URLWithString:post];
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL: url]; NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL: url];
[urlRequest addValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; [urlRequest addValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[urlRequest addValue:@"application/json" forHTTPHeaderField:@"Accept"]; [urlRequest addValue:@"application/json" forHTTPHeaderField:@"Accept"];
NSDictionary *mapData = [[NSDictionary alloc] initWithObjectsAndKeys: @"Sonar", @"app", NSDictionary *mapData = [[NSDictionary alloc] initWithObjectsAndKeys: @"Flipper", @"app",
@"Its awesome", @"remarks", @"Its awesome", @"remarks",
nil]; nil];
NSError *error = nil; NSError *error = nil;
@@ -60,7 +60,7 @@
- (IBAction)tappedGetAPI:(UIButton *)sender { - (IBAction)tappedGetAPI:(UIButton *)sender {
__weak NetworkViewController *weakSelf = self; __weak NetworkViewController *weakSelf = self;
[[[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@"https://demo9512366.mockable.io/"] completionHandler:^(NSData *_Nullable data, NSURLResponse *_Nullable response, NSError *_Nullable error) { [[[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@"https://demo9512366.mockable.io/FlipperGet"] completionHandler:^(NSData *_Nullable data, NSURLResponse *_Nullable response, NSError *_Nullable error) {
if (error || !data) { if (error || !data) {
UIAlertController *alertController = [weakSelf alertControllerForMessage:@"Received error in GET API response"]; UIAlertController *alertController = [weakSelf alertControllerForMessage:@"Received error in GET API response"];
[weakSelf presentViewController:alertController animated:true completion:nil]; [weakSelf presentViewController:alertController animated:true completion:nil];
@@ -75,7 +75,7 @@
- (UIAlertController *)alertControllerForMessage:(nonnull NSString *)msg { - (UIAlertController *)alertControllerForMessage:(nonnull NSString *)msg {
UIAlertController *controller = [UIAlertController alertControllerWithTitle:@"Sonar" message:msg preferredStyle:UIAlertControllerStyleAlert]; UIAlertController *controller = [UIAlertController alertControllerWithTitle:@"Flipper" message:msg preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *action = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:nil]; UIAlertAction *action = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:nil];
[controller addAction:action]; [controller addAction:action];
return controller; return controller;

View File

@@ -377,7 +377,7 @@
"\"UIKit\"", "\"UIKit\"",
"-DFB_SONARKIT_ENABLED=1", "-DFB_SONARKIT_ENABLED=1",
); );
PRODUCT_BUNDLE_IDENTIFIER = FB.Sample; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.flipper;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
@@ -441,7 +441,7 @@
"\"UIKit\"", "\"UIKit\"",
"-DFB_SONARKIT_ENABLED=1", "-DFB_SONARKIT_ENABLED=1",
); );
PRODUCT_BUNDLE_IDENTIFIER = FB.Sample; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.flipper;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };

View File

@@ -341,7 +341,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.sonar.SampleSwift; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.flipper.SampleSwift;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0; SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@@ -375,7 +375,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.sonar.SampleSwift; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.flipper.SampleSwift;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0; SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";

View File

@@ -24,14 +24,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let mainViewController = storyboard.instantiateViewController(withIdentifier: "MainViewController") let mainViewController = storyboard.instantiateViewController(withIdentifier: "MainViewController")
let navigationController = UINavigationController(rootViewController: mainViewController) let navigationController = UINavigationController(rootViewController: mainViewController)
navigationController.navigationBar.topItem?.title = "SampleSwift"; navigationController.navigationBar.topItem?.title = "SampleFlipper";
navigationController.navigationBar.isTranslucent = false; navigationController.navigationBar.isTranslucent = false;
window?.rootViewController = navigationController window?.rootViewController = navigationController
window?.makeKeyAndVisible() window?.makeKeyAndVisible()
// Use NSLog since Sonar doesn't capture print() by default // Use NSLog since Flipepr doesn't capture print() by default
NSLog("Hello from Sonar in a Swift app!") NSLog("Hello from Flipper in a Swift app!")
return true return true
} }