File tree 2 files changed +33
-0
lines changed
library/src/main/java/com/android/sebiya/firebase
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -81,5 +81,17 @@ and send firebase event using object.
81
81
```
82
82
83
83
84
+ ```Java
85
+ public static class User {
86
+ @FirebaseParam (" userId" )
87
+ String id;
88
+ @FirebaseParam (" userName" )
89
+ String name;
90
+ }
91
+
92
+ SimpleFirebaseAnalytics.sendEvent ("create ", user );
93
+ ```
94
+
95
+
84
96
#### Limitation
85
97
- use AppCompatActivity to use Fragment screen logging (FragmentLifeCycle observing supported since API level 26 )
Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ public void onActivityDestroyed(Activity activity) {
74
74
}
75
75
}
76
76
});
77
+ } else {
78
+ Log .e (LOG_TAG , "init. already init called. so ignore this init method" );
77
79
}
78
80
}
79
81
@@ -118,4 +120,23 @@ public static void sendEvent(Object obj) {
118
120
}
119
121
}
120
122
}
123
+
124
+ public static void sendEvent (String event , Object paramObj ) {
125
+ if (!sAnalytics .isUserAgreed ()) {
126
+ return ;
127
+ }
128
+ Bundle param = FirebaseAnnotationParser .getParam (paramObj );
129
+ if (param != null ) {
130
+ sAnalytics .logEvent (event , param );
131
+ if (ENABLE_DEBUG_LOG ) {
132
+ String str = LOG_TAG ;
133
+ StringBuilder stringBuilder = new StringBuilder ();
134
+ stringBuilder .append ("sendEvent. event - " );
135
+ stringBuilder .append (event );
136
+ stringBuilder .append (", param - " );
137
+ stringBuilder .append (param );
138
+ Log .d (str , stringBuilder .toString ());
139
+ }
140
+ }
141
+ }
121
142
}
You can’t perform that action at this time.
0 commit comments