Skip to content

Commit f656e5b

Browse files
committed
Add snippet for getting Firestore instance in cpp
1 parent d0b87c5 commit f656e5b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

firestore/ios/firestore-snippets-cpp/AppDelegate.mm

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,23 @@
1717
#import "AppDelegate.h"
1818
#import <Firebase/Firebase.h>
1919
#include "firebase/app.h"
20+
#include "firebase/firestore.h"
2021

2122
@interface AppDelegate ()
2223

2324
@end
2425

2526
@implementation AppDelegate
2627

27-
2828
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
2929
[FIRApp configure];
30+
#pragma clang diagnostic push
31+
#pragma clang diagnostic ignored "-Wunused-variable"
32+
// [START get_firestore_instance]
3033
firebase::App::Create();
34+
auto db = firebase::firestore::Firestore::GetInstance();
35+
// [END get_firestore_instance]
36+
#pragma clang diagnostic pop
3137
return YES;
3238
}
3339

0 commit comments

Comments
 (0)