소개
게시글
질문&답변
2021.01.22
getDownloadUrl
스토어에 putFile 할때 .continueWithTask 써서 저장위치 url 얻어오면 돼요 // 이미지 스토어와 db 에 넣기 private void inputImgToFirebaseDatabase(Uri imageUri) { mStorage .getReference().child( "userImages" ).child( mAuth .getCurrentUser().getUid()).putFile(imageUri).continueWithTask( new Continuation >() { @Override public Task then( @NonNull Task task) throws Exception { if (!task.isSuccessful()) { throw task.getException(); } // Continue with the task to get the download URL return mStorage .getReference().child( "userImages" ).child( mAuth .getCurrentUser().getUid()).getDownloadUrl(); } }).addOnCompleteListener( new OnCompleteListener () { @Override public void onComplete( @NonNull Task task) { String strImageUrl = task.getResult().toString(); User user = new User(); user. name = editTextUserName .getText().toString(); user. profileImgUrl = strImageUrl; mDatabase .getReference().child( "users" ).child( mAuth .getCurrentUser().getUid()).setValue(user); Toast. makeText (UserActivity. this , " 변경 완료 !" , Toast. LENGTH_SHORT ).show(); finish(); startActivity(getIntent()); } }); }
- 0
- 8
- 388
질문&답변
2021.01.19
파이어베이스 임포트 할때 저는 자동으로 임포트가 되지 않습니다.
console에서 변경사항 게시하고 android 에서 key로 getter 쓰면 Remote Config의 기본값이 불러와져요
- 0
- 1
- 139