This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Firebase 이메일 주소 바꾸기 | |
// 마찬가지로 버튼을 생성해줍니다. | |
// 다이얼로그로 처리해줍시다. | |
button.setOnClickListener { | |
var editTextNewId = EditText(this) | |
var alertDialog = AlertDialog.Builder(this) | |
alertDialog.setView(editTextNewId) | |
alertDialog.setTitle("아이디 변경") | |
alertDialog.setMessage("변경 아이디") | |
alertDialog.setPositiveButton("확인", {dialogInterface, i -> changeId(editTextNewId.text.toString())}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Firebase 비밀번호 찾기 | |
// 이메일을 통해 비밀번호를 재설정합니다. 찾는 것을 불가능합니다. | |
// 비밀번호를 찾는 버튼을 생성합니다. -> 새로운 액티비티를 생성합니다.(이메일을 통해 비밀번호를 재설정 할 수 있도록 합니다.) -> 다이얼로그 처리해도 좋을 듯 합니다. | |
1. 비밀번호 재설정 메소드를 새로운 액티비티에 입력합니다. | |
fun findPassword() { | |
FirebaseAuth.getInstance().sendPasswordResetEmail(editText_email.text.toString()) | |
.addOnCompleteListener { task -> | |
if (task.isSuccessful) { | |
Toast("재설정 메일을 보냈습니다.") | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Firebase 이메일 주소 유효 확인 | |
// 이메일을 체크하는 메소드입니다. | |
fun sendEmailVerification() { | |
FirebaseAuth.getInstance().currentUser!!.sendEmailVerification().addOnCompleteListener { task -> | |
if (task.isSuccessful) { | |
Toast("확인 메일을 전송했습니다.") | |
} else { | |
Toast(task.exception) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Firebase 비밀번호 변경 | |
1. 비밀번호 변경을 담당할 버튼을 생성합니다. | |
2. dialog 창을 띄워 비밀번호 변경을 처리하도록 하는게 편리합니다. | |
예제 코드) | |
var editTextNewPassword = EditText(this) | |
// 별표처리 | |
editTextNewPassword.transformationMethod = PasswordTransformationMethod.getInstance() | |
var alertDialog = AlertDialog.Builder(this) | |
alertDialog.setTitle("") | |
alertDialog.setMessage("") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13. Firebase – Receive DynamicLink | |
● 메모장, 카카오톡에 url 올리면 기타 앱, 이벤트에 참여 및 발생하게 됩니다. | |
● 예를 들어, 맛집 url을 올리면 관련 문서로 바로 이동하게 됩니다. | |
* Firebase 서버를 통해 링크를 작동시킵니다. | |
1. 문서로 이동합니다. 다이나믹 링크 수신 탭으로 이동합니다. Intent-filter를 매니페스트 내 해당 액티비티에 입력합니다. | |
- 호스트에 입력한 주소와 앱 내 링크 주소가 동일하면 작동시키는 원리라고 볼 수 있습니다. | |
- http는 삭제합니다. | |
- 앱 코드를 불러와 호스트 주소에 입력합니다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13. Firebase – Create DynamicLinks | |
1. 새로운 프로젝트를 생성합니다. Firebase 연동시킵니다. | |
2. 문서로 이동 – dynamiclinks – create – android를 참조합니다. | |
- 컴파일 코드를 삽입합니다. | |
3. 사용하기 위해서 앱 코드가 필요합니다. 콘솔 – 다이나믹 링크로 이동합니다. 이 페이지의 url 주소가 앱 코드입니다. | |
4. 문서로 이동하여 파라미터 값을 활용한 다이나믹 링크 생성 문서를 참조합니다. DynamicLink 생성 코드를 복사합니다. 복사해서 onCreate 메소드에 삽입합니다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11. Firebase – Remote Config(Change Value) | |
● 원격으로 앱의 배경색, 프로레스 작동 및 종료가 가능합니다. | |
1. 문서로 이동합니다. 원격 구성 탭으로 이동합니다. | |
- compile 코드를 붙여넣습니다. | |
- 작동 원리 부분의 mFirebaseRemoteConfig 코드를 가져옵니다. HomeActivity로 이동하여 remoteConfig() 메소드를 생성해 바디 부분으로 붙여넣습니다. 에러는 스스로 잡습니다. | |
해당 코드는 디버깅 테스트를 할 때 에러를 잡아주는 기능입니다. | |
- 문서 내 하단의 디폴트 설정 값을 입력하는 코드도 복사해 해당 메소드 하단에 붙여넣습니다. | |
해당 코드는 서버에 해당되는 값이 없을 때 참조하는 기능입니다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10. Firebase – Crash Reporting(Catch Crash) | |
● 디버깅 작업의 일부로 볼수도 있습니다. 즉, 버그가 어디서 터지는지 잡을 수 있습니다. | |
● 대개 파이어베이스 서버에 보고하는 데 3분정도 걸린다고 합니다. | |
● 현재, Firebase 오류 보고에서 Firebase Crashlytics로 업그레이드 되었습니다. | |
* 고로 사실 하단 방법들은 쓸모 없음. | |
● https://firebase.google.com/docs/crashlytics/get-started?authuser=0 여길 참조합니다. | |
1. 문서로 이동 – 오류 보고에서 라이브러리 코드를 가져옵니다. 입력하면 자동으로 에러가 보고됩니다. | |
implementation 'com.google.firebase:firebase-crash:16.0.0' |
NewerOlder