Skip to content

Commit 0630c71

Browse files
Salakarpaulb777
authored andcommitted
[docs] fix syntax errors & enable highlighting (#3466)
1 parent 55463b1 commit 0630c71

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

Interop/FirebaseComponentSystem.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Each Firebase framework should register with Core in the `+load` method of the c
9292
`FIRLibrary`. This needs to happen at `+load` time because Core needs to resolve any
9393
dependencies before a class has a chance to be called by a developer (if called at all).
9494

95-
```
95+
```obj-c
9696
#import <FirebaseCore/FIRAppInternal.h>
9797
#import <FirebaseCore/FIRComponentContainer.h>
9898
#import <FirebaseCore/FIRLibrary.h>
@@ -106,8 +106,8 @@ dependencies before a class has a chance to be called by a developer (if called
106106
// Register with Core as a library. The version should be fetched from a constant defined
107107
// elsewhere, but that's not covered or relevant for this example.
108108
[FIRApp registerInternalLibrary:self
109-
withName:"fire-foo"
110-
withVersion:"1.0.0"];
109+
withName:@"fire-foo"
110+
withVersion:@"1.0.0"];
111111
}
112112

113113
// TODO: Conform to `FIRLibrary`. See later sections for more information.
@@ -136,7 +136,7 @@ In this case, the framework is a "leaf node" since no other frameworks depend on
136136
it. It has a private, empty protocol that it uses to register with the container. Using Functions as
137137
an example:
138138
139-
```
139+
```obj-c
140140
// FIRFunctions.m
141141
142142
/// Empty protocol to register Functions as a component with Core.
@@ -150,8 +150,8 @@ an example:
150150
@implementation FIRFunctions
151151
152152
+ (void)load {
153-
NSString *version = <# Fetch the version here #>;
154-
[FIRApp registerInternalLibrary:self withName:"fire-fun" withVersion:version];
153+
NSString *version = @"<# Fetch the version here #>";
154+
[FIRApp registerInternalLibrary:self withName:@"fire-fun" withVersion:version];
155155
}
156156
157157
/// The array of components to register with Core. Since Functions is a leaf node and
@@ -201,7 +201,7 @@ an example:
201201
This example will be very similar to the one above, but let's define a simple protocol that Auth
202202
could conform to and provide to other frameworks:
203203

204-
```
204+
```obj-c
205205
// FIRAuthInterop.h in the FirebaseAuthInterop framework.
206206

207207
@protocol FIRAuthInterop
@@ -210,7 +210,7 @@ could conform to and provide to other frameworks:
210210
@end
211211
```
212212
213-
```
213+
```obj-c
214214
// FIRAuth.m in the FirebaseAuth framework.
215215
216216
/// Privately conform to the protocol for interop and component registration.
@@ -219,8 +219,8 @@ could conform to and provide to other frameworks:
219219
220220
+ (void)load {
221221
// Remember to register in +load!
222-
NSString *version = <# Fetch the version here #>;
223-
[FIRApp registerInternalLibrary:self withName:"fire-auth" withVersion:version];
222+
NSString *version = @"<# Fetch the version here #>";
223+
[FIRApp registerInternalLibrary:self withName:@"fire-auth" withVersion:version];
224224
}
225225
226226
/// The components to register with Core.
@@ -251,7 +251,7 @@ Instead of directly providing an instance from the container, Firestore and simi
251251
create a "provider" that stores and creates instances with the required parameters. This means a
252252
single provider per `FIRApp`, but multiple instances are possible per provider.
253253

254-
```
254+
```obj-c
255255
/// Provider protocol to register with Core.
256256
@protocol FSTFirestoreMultiDBProvider
257257

@@ -269,7 +269,7 @@ single provider per `FIRApp`, but multiple instances are possible per provider.
269269
Instead of the Firestore class conforming to `FSTInstanceProvider`, the work can be done in a
270270
separate class to keep `Firestore.m` cleaner.
271271
272-
```
272+
```obj-c
273273
/// A concrete implementation for FSTFirestoreMultiDBProvider to create Firestore instances.
274274
@interface FSTFirestoreComponent : NSObject <FSTFirestoreMultiDBProvider, FIRLibrary>
275275
@@ -294,8 +294,8 @@ separate class to keep `Firestore.m` cleaner.
294294
295295
+ (void)load {
296296
// Remember to register in +load!
297-
NSString *version = <# Fetch the version here #>;
298-
[FIRApp registerInternalLibrary:self withName:"fire-fst" withVersion:version];
297+
NSString *version = @"<# Fetch the version here #>";
298+
[FIRApp registerInternalLibrary:self withName:@"fire-fst" withVersion:version];
299299
}
300300
301301
- (instancetype)initWithApp:(FIRApp *)app {
@@ -334,7 +334,7 @@ separate class to keep `Firestore.m` cleaner.
334334

335335
All `Firestore.m` needs to do now is call the component container from the singleton calls:
336336

337-
```
337+
```obj-c
338338
+ (instancetype)firestoreForApp:(FIRApp *)app database:(NSString *)database {
339339
id<FSTFirestoreMultiDBProvider> provider =
340340
FIR_COMPONENT(FSTFirestoreMultiDBProvider, app.container);
@@ -355,7 +355,7 @@ Functions above and add a dependency to `FIRAuthInterop` defined above.
355355

356356
Before adding the dependency on `FIRAuthInterop`.
357357

358-
```
358+
```obj-c
359359
+ (NSArray<FIRComponent *> *)componentsToRegister {
360360
FIRComponentCreationBlock creationBlock =
361361
^id _Nullable(FIRComponentContainer *container, BOOL *isCacheable) {
@@ -373,7 +373,7 @@ Before adding the dependency on `FIRAuthInterop`.
373373

374374
After adding the dependency on `FIRAuthInterop`. See comments with "ADDED:".
375375

376-
```
376+
```obj-c
377377
+ (NSArray<FIRComponent *> *)componentsToRegister {
378378
FIRComponentCreationBlock creationBlock =
379379
^id _Nullable(FIRComponentContainer *container, BOOL *isCacheable) {
@@ -413,7 +413,7 @@ After adding the dependency on `FIRAuthInterop`. See comments with "ADDED:".
413413
Based on the new constructor, Functions can now use the `auth` instance as defined by the
414414
protocol:
415415

416-
```
416+
```obj-c
417417
NSString *userID = [auth getUserID];
418418
if (userID) {
419419
// Auth is available and a user is signed in!
@@ -434,7 +434,7 @@ In order to alleviate this, Auth could create a third private protocol
434434
becomes a dependency for each of those two components and returned in the component creation block.
435435
An abbreviated code sample:
436436

437-
```
437+
```obj-c
438438

439439
+ (NSArray<FIRComponent *> *)componentsToRegister {
440440
// Standard creation block to get an instance of Auth.

0 commit comments

Comments
 (0)