ViewController.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. // Copyright 2019 Google
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import "ViewController.h"
  15. #import <FirebaseAnalytics/FirebaseAnalytics.h>
  16. #import <FirebaseCore/FIROptions.h>
  17. #import <FirebaseCore/FirebaseCore.h>
  18. #import <FirebaseInstallations/FirebaseInstallations.h>
  19. #import <FirebaseRemoteConfig/FirebaseRemoteConfig.h>
  20. #import "../../../Sources/Private/FIRRemoteConfig_Private.h"
  21. #import "FRCLog.h"
  22. static NSString *const FIRPerfNamespace = @"fireperf";
  23. static NSString *const FIRDefaultFIRAppName = @"__FIRAPP_DEFAULT";
  24. static NSString *const FIRSecondFIRAppName = @"secondFIRApp";
  25. @interface FIRRemoteConfig (Sample)
  26. + (FIRRemoteConfig *)remoteConfigWithFIRNamespace:(NSString *)remoteConfigNamespace
  27. app:(FIRApp *)app;
  28. @end
  29. @interface ViewController ()
  30. @property(nonatomic, strong) IBOutlet UIButton *fetchButton;
  31. @property(nonatomic, strong) IBOutlet UIButton *applyButton;
  32. @property(nonatomic, strong) IBOutlet UIButton *refreshButton;
  33. @property(nonatomic, strong) IBOutlet UIButton *clearLogsButton;
  34. @property(nonatomic, strong) IBOutlet UITextView *mainTextView;
  35. /// Key of custom variable to be added by user.
  36. @property(nonatomic, weak) IBOutlet UITextField *keyLabel;
  37. /// Value of custom variable to be added by user.
  38. @property(nonatomic, weak) IBOutlet UITextField *valueLabel;
  39. /// Expiration in seconds to be set by user.
  40. @property(nonatomic, weak) IBOutlet UITextField *expirationLabel;
  41. /// Config Defaults.
  42. @property(nonatomic, strong) NSMutableDictionary *configDefaults;
  43. /// developer mode switch.
  44. @property(strong, nonatomic) IBOutlet UISwitch *developerModeEnabled;
  45. /// Current selected namespace.
  46. @property(nonatomic, copy) NSString *currentNamespace;
  47. /// Curret selected FIRApp instance name.
  48. @property(nonatomic, copy) NSString *FIRAppName;
  49. /// Selected namespace picker control view.
  50. @property(nonatomic, strong) IBOutlet UIPickerView *namespacePicker;
  51. /// Selected app picker control view.
  52. @property(nonatomic, strong) IBOutlet UIPickerView *appPicker;
  53. /// Array of prepopulated namespaces supported by this app.
  54. @property(nonatomic, strong) NSArray<NSString *> *namespacePickerData;
  55. /// Array of prepopulated FIRApp names supported by this app.
  56. @property(nonatomic, strong) NSArray<NSString *> *appPickerData;
  57. /// Array of Remote Config instances.
  58. @property(nonatomic, strong) NSMutableDictionary *RCInstances;
  59. @end
  60. @implementation ViewController
  61. - (void)viewDidLoad {
  62. [super viewDidLoad];
  63. [[FRCLog sharedInstance] setLogView:self.mainTextView];
  64. [[FRCLog sharedInstance] logToConsole:@"Viewcontroller loaded"];
  65. [[FRCLog sharedInstance] logToConsole:[[NSBundle mainBundle] bundleIdentifier]];
  66. // Setup UI
  67. self.expirationLabel.text = [NSString stringWithFormat:@"0"];
  68. self.configDefaults = [[NSMutableDictionary alloc] init];
  69. self.keyLabel.delegate = self;
  70. self.valueLabel.delegate = self;
  71. self.expirationLabel.delegate = self;
  72. self.mainTextView.editable = NO;
  73. // TODO(mandard): Add support for deleting and adding namespaces in the app.
  74. self.namespacePickerData =
  75. [[NSArray alloc] initWithObjects:FIRNamespaceGoogleMobilePlatform, FIRPerfNamespace, nil];
  76. self.appPickerData =
  77. [[NSArray alloc] initWithObjects:FIRDefaultFIRAppName, FIRSecondFIRAppName, nil];
  78. self.RCInstances = [[NSMutableDictionary alloc] init];
  79. for (NSString *namespaceString in self.namespacePickerData) {
  80. for (NSString *appString in self.appPickerData) {
  81. // Check for the default instance.
  82. if (!self.RCInstances[namespaceString]) {
  83. self.RCInstances[namespaceString] = [[NSMutableDictionary alloc] init];
  84. }
  85. if ([namespaceString isEqualToString:FIRNamespaceGoogleMobilePlatform] &&
  86. [appString isEqualToString:FIRDefaultFIRAppName]) {
  87. self.RCInstances[namespaceString][appString] = [FIRRemoteConfig remoteConfig];
  88. } else {
  89. FIRApp *firebaseApp = ([appString isEqualToString:FIRDefaultFIRAppName])
  90. ? [FIRApp defaultApp]
  91. : [FIRApp appNamed:appString];
  92. self.RCInstances[namespaceString][appString] =
  93. [FIRRemoteConfig remoteConfigWithFIRNamespace:namespaceString app:firebaseApp];
  94. }
  95. FIRRemoteConfigSettings *settings = [[FIRRemoteConfigSettings alloc] init];
  96. settings.fetchTimeout = 300;
  97. settings.minimumFetchInterval = 300;
  98. ((FIRRemoteConfig *)(self.RCInstances[namespaceString][appString])).configSettings = settings;
  99. }
  100. }
  101. // Add realtime listener for firebase namespace
  102. [self.RCInstances[FIRNamespaceGoogleMobilePlatform][FIRDefaultFIRAppName]
  103. addOnConfigUpdateListener:^(NSError *_Nullable error) {
  104. if (error != nil) {
  105. [[FRCLog sharedInstance]
  106. logToConsole:[NSString
  107. stringWithFormat:@"Realtime Error: %@", error.localizedDescription]];
  108. } else {
  109. [[FRCLog sharedInstance] logToConsole:[NSString stringWithFormat:@"Config updated!"]];
  110. }
  111. }];
  112. [[FRCLog sharedInstance] logToConsole:@"RC instances inited"];
  113. self.namespacePicker.dataSource = self;
  114. self.namespacePicker.delegate = self;
  115. self.appPicker.dataSource = self;
  116. self.appPicker.delegate = self;
  117. [self.developerModeEnabled setOn:true animated:false];
  118. }
  119. - (IBAction)fetchButtonPressed:(id)sender {
  120. [[FRCLog sharedInstance] logToConsole:@"Fetch button pressed"];
  121. // fetchConfig api callback, this is triggered when client receives response from server
  122. ViewController *__weak weakSelf = self;
  123. FIRRemoteConfigFetchCompletion completion = ^(FIRRemoteConfigFetchStatus status, NSError *error) {
  124. ViewController *strongSelf = weakSelf;
  125. if (!strongSelf) {
  126. return;
  127. }
  128. [[FRCLog sharedInstance]
  129. logToConsole:[NSString stringWithFormat:@"Fetch completed. Status=%@",
  130. [strongSelf statusString:status]]];
  131. if (error) {
  132. [[FRCLog sharedInstance] logToConsole:[NSString stringWithFormat:@"Fetch Error=%@", error]];
  133. }
  134. NSMutableString *output = [NSMutableString
  135. stringWithFormat:@"Fetch status : %@.\n\n", [strongSelf statusString:status]];
  136. if (error) {
  137. [output appendFormat:@"%@\n", error];
  138. }
  139. if (status == FIRRemoteConfigFetchStatusFailure) {
  140. [output appendString:[NSString stringWithFormat:@"Fetch Error :%@.\n",
  141. [strongSelf errorString:error.code]]];
  142. if (error.code == FIRRemoteConfigErrorThrottled) {
  143. NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  144. NSNumber *throttledTime =
  145. (NSNumber *)error.userInfo[FIRRemoteConfigThrottledEndTimeInSecondsKey];
  146. NSDate *date = [NSDate dateWithTimeIntervalSince1970:[throttledTime doubleValue]];
  147. [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
  148. NSString *timeString = [dateFormatter stringFromDate:date];
  149. [output appendString:[NSString stringWithFormat:@"Throttled end at: %@ \n", timeString]];
  150. }
  151. }
  152. [[FRCLog sharedInstance] logToConsole:output];
  153. };
  154. // fetchConfig api call
  155. [[FRCLog sharedInstance] logToConsole:@"Calling fetchWithExpirationDuration.."];
  156. [self.RCInstances[self.currentNamespace][self.FIRAppName]
  157. fetchWithExpirationDuration:self.expirationLabel.text.integerValue
  158. completionHandler:completion];
  159. }
  160. - (IBAction)fetchAndActivateButtonPressed:(id)sender {
  161. // fetchConfig api callback, this is triggered when client receives response from server
  162. ViewController *__weak weakSelf = self;
  163. FIRRemoteConfigFetchAndActivateCompletion fetchAndActivateCompletion = ^(
  164. FIRRemoteConfigFetchAndActivateStatus status, NSError *error) {
  165. ViewController *strongSelf = weakSelf;
  166. if (!strongSelf) {
  167. return;
  168. }
  169. NSMutableString *output = [@"Fetch and activate status :" mutableCopy];
  170. if (status == FIRRemoteConfigFetchAndActivateStatusSuccessFetchedFromRemote) {
  171. [output appendString:@"Success from remote fetch."];
  172. } else if (status == FIRRemoteConfigFetchAndActivateStatusSuccessUsingPreFetchedData) {
  173. [output appendString:@"Success using pre-fetched data."];
  174. } else if (status == FIRRemoteConfigFetchAndActivateStatusError) {
  175. [output
  176. appendString:[NSString stringWithFormat:@"Failure: %@", [error localizedDescription]]];
  177. }
  178. if (error) {
  179. [output appendFormat:@"%@\n", error];
  180. }
  181. if (status == FIRRemoteConfigFetchAndActivateStatusError) {
  182. [output appendString:[NSString stringWithFormat:@"Fetch And Activate Error :%@.\n",
  183. [strongSelf errorString:error.code]]];
  184. if (error.code == FIRRemoteConfigErrorThrottled) {
  185. [output appendString:[NSString stringWithFormat:@"Throttled.\n"]];
  186. }
  187. }
  188. // activate status
  189. [[FRCLog sharedInstance] logToConsole:output];
  190. if (status == FIRRemoteConfigFetchAndActivateStatusSuccessFetchedFromRemote ||
  191. status == FIRRemoteConfigFetchAndActivateStatusSuccessUsingPreFetchedData) {
  192. [strongSelf printResult:[[NSMutableString alloc] init]];
  193. }
  194. };
  195. // fetchConfig api call
  196. [self.RCInstances[self.currentNamespace][self.FIRAppName]
  197. fetchAndActivateWithCompletionHandler:fetchAndActivateCompletion];
  198. }
  199. - (IBAction)activateButtonPressed:(id)sender {
  200. [self apply];
  201. }
  202. - (IBAction)refreshButtonPressed:(id)sender {
  203. NSMutableString *output = [[NSMutableString alloc] init];
  204. [self printResult:output];
  205. }
  206. - (IBAction)setDefaultFromPlistButtonPressed:(id)sender {
  207. [self.RCInstances[self.currentNamespace][self.FIRAppName]
  208. setDefaultsFromPlistFileName:@"Defaults"];
  209. [self printDefaultConfigs];
  210. }
  211. - (IBAction)setDefaultButtonPressed:(id)sender {
  212. if (self.configDefaults.count) {
  213. [self.RCInstances[self.currentNamespace][self.FIRAppName] setDefaults:self.configDefaults];
  214. [self.configDefaults removeAllObjects];
  215. [self printDefaultConfigs];
  216. } else {
  217. [[FRCLog sharedInstance] logToConsole:@"Nothing to set for defaults."];
  218. }
  219. }
  220. - (IBAction)onClearLogsButtonPressed:(id)sender {
  221. self.mainTextView.text = @"";
  222. }
  223. - (void)printDefaultConfigs {
  224. NSMutableString *output = [[NSMutableString alloc] init];
  225. [output appendString:@"\n-------Default config------\n"];
  226. NSArray<NSString *> *result = [self.RCInstances[self.currentNamespace][self.FIRAppName]
  227. allKeysFromSource:FIRRemoteConfigSourceDefault];
  228. if (result) {
  229. NSString *stringPerNs = @"";
  230. for (NSString *key in result) {
  231. FIRRemoteConfigValue *value =
  232. [self.RCInstances[self.currentNamespace][self.FIRAppName] defaultValueForKey:key];
  233. stringPerNs = [NSString stringWithFormat:@"%@%@ : %@ : %@\n", stringPerNs,
  234. self.currentNamespace, key, value.stringValue];
  235. }
  236. [output appendString:stringPerNs];
  237. }
  238. [[FRCLog sharedInstance] logToConsole:output];
  239. }
  240. - (IBAction)getValueButtonPressed:(id)sender {
  241. [[FRCLog sharedInstance] logToConsole:[self.RCInstances[self.currentNamespace][self.FIRAppName]
  242. configValueForKey:self.keyLabel.text]
  243. .debugDescription];
  244. }
  245. - (IBAction)logValueButtonPressed:(id)sender {
  246. [[FRCLog sharedInstance]
  247. logToConsole:[NSString stringWithFormat:@"key: %@ logged", self.keyLabel.text]];
  248. }
  249. // add default variable button pressed
  250. - (IBAction)addButtonPressed:(id)sender {
  251. [self addNewEntryToVariables:self.configDefaults isDefaults:YES];
  252. }
  253. - (IBAction)developerModeSwitched:(id)sender {
  254. FIRRemoteConfigSettings *configSettings = [[FIRRemoteConfigSettings alloc] init];
  255. ((FIRRemoteConfig *)(self.RCInstances[self.currentNamespace][self.FIRAppName])).configSettings =
  256. configSettings;
  257. }
  258. - (void)addNewEntryToVariables:(NSMutableDictionary *)variables isDefaults:(BOOL)isDefaults {
  259. if ([self.keyLabel.text length]) {
  260. variables[self.keyLabel.text] = self.valueLabel.text;
  261. NSString *showText = @"custom variables ";
  262. if (isDefaults) {
  263. showText = @"config defaults";
  264. }
  265. [[FRCLog sharedInstance]
  266. logToConsole:[NSString stringWithFormat:@"New %@ added %@ : %@\n", showText,
  267. self.keyLabel.text, self.valueLabel.text]];
  268. self.keyLabel.text = @"";
  269. self.valueLabel.text = @"";
  270. }
  271. }
  272. - (void)apply {
  273. [self.RCInstances[self.currentNamespace][self.FIRAppName]
  274. activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
  275. NSMutableString *output = [[NSMutableString alloc] init];
  276. [output appendString:[NSString stringWithFormat:@"ActivateFetched = %@\n",
  277. changed ? @"YES" : @"NO"]];
  278. [[FRCLog sharedInstance] logToConsole:output];
  279. if (!error) {
  280. [self printResult:output];
  281. } else {
  282. [self printResult:[[NSString stringWithFormat:@"Activate failed. Error: %@",
  283. error.localizedDescription] mutableCopy]];
  284. }
  285. }];
  286. }
  287. // print out fetch result
  288. - (void)printResult:(NSMutableString *)output {
  289. FIRRemoteConfig *currentRCInstance = self.RCInstances[self.currentNamespace][self.FIRAppName];
  290. NSString *namespace_p = self.currentNamespace;
  291. [output appendString:@"-------Active config------\n"];
  292. NSArray<NSString *> *result = [self.RCInstances[self.currentNamespace][self.FIRAppName]
  293. allKeysFromSource:FIRRemoteConfigSourceRemote];
  294. if (result) {
  295. NSString *stringPerNs = @"";
  296. for (NSString *key in result) {
  297. FIRRemoteConfigValue *value = [currentRCInstance configValueForKey:key];
  298. stringPerNs = [NSString
  299. stringWithFormat:@"%@%@ : %@ : %@\n", stringPerNs, namespace_p, key, value.stringValue];
  300. }
  301. [output appendString:stringPerNs];
  302. }
  303. [output appendString:@"\n-------Default config------\n"];
  304. result = [currentRCInstance allKeysFromSource:FIRRemoteConfigSourceDefault];
  305. if (result) {
  306. NSString *stringPerNs = @"";
  307. for (NSString *key in result) {
  308. FIRRemoteConfigValue *value = [currentRCInstance defaultValueForKey:key];
  309. stringPerNs = [NSString
  310. stringWithFormat:@"%@%@ : %@ : %@\n", stringPerNs, namespace_p, key, value.stringValue];
  311. }
  312. [output appendString:stringPerNs];
  313. }
  314. [output appendString:@"\n--------Custom Variables--------\n"];
  315. [output appendString:@"\n----------Last fetch time----------------\n"];
  316. NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  317. [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
  318. [output
  319. appendString:[NSString stringWithFormat:@"%@\n",
  320. [dateFormatter
  321. stringFromDate:currentRCInstance.lastFetchTime]]];
  322. [output appendString:@"\n-----------Last fetch status------------\n"];
  323. [output appendString:[NSString
  324. stringWithFormat:@"%@\n",
  325. [self statusString:currentRCInstance.lastFetchStatus]]];
  326. FIRInstallations *installations = [FIRInstallations installations];
  327. [installations installationIDWithCompletion:^(NSString *_Nullable identifier,
  328. NSError *_Nullable error) {
  329. [output appendString:@"\n-----------Installation ID------------------\n"];
  330. [output appendString:[NSString stringWithFormat:@"%@\n", identifier]];
  331. [output appendString:@"\n-----------Installation ID token------------\n"];
  332. [installations authTokenWithCompletion:^(FIRInstallationsAuthTokenResult *_Nullable tokenResult,
  333. NSError *_Nullable error) {
  334. [output appendString:[NSString stringWithFormat:@"%@\n", tokenResult.authToken]];
  335. [[FRCLog sharedInstance] logToConsole:output];
  336. }];
  337. }];
  338. }
  339. - (BOOL)textFieldShouldReturn:(UITextField *)textField {
  340. [textField resignFirstResponder];
  341. return YES;
  342. }
  343. - (NSString *)statusString:(FIRRemoteConfigFetchStatus)status {
  344. switch (status) {
  345. case FIRRemoteConfigFetchStatusSuccess:
  346. return @"Success";
  347. case FIRRemoteConfigFetchStatusNoFetchYet:
  348. return @"NotFetchYet";
  349. case FIRRemoteConfigFetchStatusFailure:
  350. return @"Failure";
  351. case FIRRemoteConfigFetchStatusThrottled:
  352. return @"Throttled";
  353. default:
  354. return @"Unknown";
  355. }
  356. return @"";
  357. }
  358. - (NSString *)errorString:(FIRRemoteConfigError)error {
  359. switch (error) {
  360. case FIRRemoteConfigErrorInternalError:
  361. return @"Internal Error";
  362. case FIRRemoteConfigErrorUnknown:
  363. return @"Unknown Error";
  364. case FIRRemoteConfigErrorThrottled:
  365. return @"Throttled";
  366. default:
  367. return @"unknown";
  368. }
  369. return @"";
  370. }
  371. - (IBAction)fetchIIDButtonClicked:(id)sender {
  372. FIRInstallations *installations =
  373. [FIRInstallations installationsWithApp:[FIRApp appNamed:self.FIRAppName]];
  374. [installations installationIDWithCompletion:^(NSString *_Nullable identifier,
  375. NSError *_Nullable error) {
  376. if (error) {
  377. [[FRCLog sharedInstance] logToConsole:[NSString stringWithFormat:@"%@", error]];
  378. } else {
  379. [installations authTokenWithCompletion:^(
  380. FIRInstallationsAuthTokenResult *_Nullable tokenResult,
  381. NSError *_Nullable error) {
  382. if (tokenResult.authToken) {
  383. ((FIRRemoteConfig *)self.RCInstances[self.currentNamespace][self.FIRAppName])
  384. .settings.configInstallationsToken = tokenResult.authToken;
  385. [[FRCLog sharedInstance]
  386. logToConsole:[NSString
  387. stringWithFormat:
  388. @"Successfully got installation ID : \n\n%@\n\nToken : \n\n%@\n",
  389. identifier, tokenResult.authToken]];
  390. }
  391. }];
  392. }
  393. }];
  394. }
  395. - (IBAction)searchButtonClicked:(id)sender {
  396. NSString *output = @"-------Active Config------\n";
  397. for (NSString *key in [self.RCInstances[self.currentNamespace][self.FIRAppName]
  398. keysWithPrefix:self.keyLabel.text]) {
  399. FIRRemoteConfigValue *value =
  400. ((FIRRemoteConfig *)(self.RCInstances[self.currentNamespace][self.FIRAppName]))[key];
  401. output = [NSString stringWithFormat:@"%@%@ : %@ : %@\n", output, self.currentNamespace, key,
  402. value.stringValue];
  403. }
  404. [[FRCLog sharedInstance] logToConsole:output];
  405. }
  406. - (IBAction)userPropertyButtonClicked:(id)sender {
  407. [FIRAnalytics setUserPropertyString:self.valueLabel.text forName:self.keyLabel.text];
  408. NSString *output = [NSString
  409. stringWithFormat:@"Set User Property => %@ : %@\n", self.keyLabel.text, self.valueLabel.text];
  410. [[FRCLog sharedInstance] logToConsole:output];
  411. }
  412. #pragma mark - picker
  413. // The number of columns of data
  414. - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
  415. // App and currentNamespace pickers.
  416. return 2;
  417. }
  418. // The number of rows of data
  419. - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
  420. NSInteger rowCount = (component == 0) ? self.namespacePickerData.count : self.appPickerData.count;
  421. return rowCount;
  422. }
  423. // The data to return for the row and component (column) that's being passed in
  424. - (NSString *)pickerView:(UIPickerView *)pickerView
  425. titleForRow:(NSInteger)row
  426. forComponent:(NSInteger)component {
  427. if (component == 0) {
  428. self.currentNamespace = self.namespacePickerData[row];
  429. return self.namespacePickerData[row];
  430. } else {
  431. self.FIRAppName = self.appPickerData[row];
  432. return self.appPickerData[row];
  433. }
  434. }
  435. - (UIView *)pickerView:(UIPickerView *)pickerView
  436. viewForRow:(NSInteger)row
  437. forComponent:(NSInteger)component
  438. reusingView:(UIView *)view {
  439. UILabel *tView = (UILabel *)view;
  440. if (!tView) {
  441. tView = [[UILabel alloc] init];
  442. [tView setFont:[UIFont fontWithName:@"Helvetica" size:15]];
  443. tView.numberOfLines = 3;
  444. }
  445. if (component == 0) {
  446. self.currentNamespace = self.namespacePickerData[row];
  447. tView.text = self.namespacePickerData[row];
  448. } else {
  449. self.FIRAppName = self.appPickerData[row];
  450. tView.text = self.appPickerData[row];
  451. }
  452. return tView;
  453. }
  454. @end