-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] 앰플리튜드를 도입합니다. #140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다! 코멘트 확인해주세요!
app/src/main/AndroidManifest.xml
Outdated
@@ -6,7 +6,7 @@ | |||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> | |||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> | |||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" /> | |||
|
|||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사용자가 동의 버튼을 눌러야하는 권한인가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
�이게 최신 앰플리튜드 sdk 가이드에는 퍼미션을 받을 필요가 없어 보여서 제거하겠습니다.
val LocalTracker = | ||
compositionLocalOf<Tracker> { | ||
error("No Tracker provided") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default로 예외를 던져버리면 프리뷰 함수 내에서도 컴포지션 로컬을 provide 해주지 않을 때 미리보기가 안나옵니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
에러를 던질필요가 있을까 싶어서 기본값은 아무것도 던지지 않는 것으로 수정해보겠습니다
@@ -35,6 +35,7 @@ googleFirebaseCrashlytics = "3.0.2" | |||
datastore = "1.0.0" | |||
firebaseFirestoreKtx = "25.0.0" | |||
coil = "2.3.0" | |||
amplitude = "1.+" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+는 뭔가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앰플리튜드 공식문서에 이렇게 적혀있어서 그대로 사용했는데 알아서 최신버전을 찾는거 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+가 *동적 버전 지정
이라고 해서 최신 버전을 받아오는 것이 맞습니다.
interface Tracker { | ||
fun trackEvent( | ||
eventName: String, | ||
properties: Map<String, Any?> = emptyMap(), | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추상화 좋습니다.
하지만 properties
가 다른 tracker를 연결할 때 걸림돌이 되진 않을까여?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기본값을 명시해서 다른 tracker들은 선택적으로 사용할 수 있도록 설계하였는데 다른 tracker들이 어떤 형태를 가지는지 모르겠어서 예상이 잘 가지 않네요 일단 이 부분은 knownIssue로 가져가는 것을 제안드립니다!
object TrackerModule { | ||
@Provides | ||
@Singleton | ||
fun provideTracker( | ||
@ApplicationContext context: Context, | ||
): Tracker { | ||
return AmplitudeTracker(context, AMPLITUDE_KEY) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AMPLITUDE_KEY
라는 상수를 어디서 왔는지 표현하기 위해 다음 처럼 명시하는게 좋아보입니다.
BuildConfig.AMPLITUDE_KEY
resolved #139
AS-IS
X
TO-BE
KEY-POINT
Tracker
라는 이름으로 추상화하였습니다.autocapture
라는 속성은 앰플리튜드가 알아서 오토캡처를 해준다고해서 추가하였습니다.SCREENSHOT (Optional)