2.02 firebase storage put file #19
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello, I'm sorry but I have a problem, I do not upload the photo to my store, the rules in my firebase store console is:
service firebase.storage {
match /b/chatfriendly.appspot.com/o {
match /chat_photos/{allPaths=**} {
allow read, write: if request.auth != null && request.resource.size < 3 * 1024 * 1024;
}
}
}
And the rule in the firebase database is:
{
"rules": {
"messages": {
// only authenticated users can read and write the messages node
".read": "auth != null",
".write": "auth != null",
"$id": {
// the read and write rules cascade to the individual messages
// messages should have a 'name' and 'text' key or a 'name' and 'photoUrl' key
".validate": "newData.hasChildren(['name', 'text']) && !newData.hasChildren(['photoUrl']) || newData.hasChildren(['name', 'photoUrl']) && !newData.hasChildren(['text'])"
}
}
}
}
For authentication use the new method:
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setIsSmartLockEnabled(false)
.setProviders(Arrays.asList(
new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build(),
new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build()))
.build(), RC_SIGN_IN);
I do not know if it's the wrong extensions
build.gradle (app)
dependency {
}
apply plugin: 'com.google.gms.google-services'
build.gradle (project)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
}
}
Well the most important method for the upload is:
`@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
I give it to upload a photo, I select the photo and nothing
06-14 19:24:24.100 7781-17645/com.example.chatfriendly V/FA: Using measurement service 06-14 19:24:24.100 7781-17645/com.example.chatfriendly V/FA: Connection attempt already in progress 06-14 19:24:24.101 7781-17645/com.example.chatfriendly D/FA: Connected to remote service 06-14 19:24:24.102 7781-17645/com.example.chatfriendly V/FA: Processing queued up service tasks: 2 06-14 19:24:24.160 7781-7781/com.example.chatfriendly W/IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection 06-14 19:24:24.160 7781-7781/com.example.chatfriendly W/IInputConnectionWrapper: finishComposingText on inactive InputConnection 06-14 19:24:29.498 7781-17645/com.example.chatfriendly V/FA: Inactivity, disconnecting from the service 06-14 19:24:30.114 7781-17645/com.example.chatfriendly V/FA: Using measurement service 06-14 19:24:30.114 7781-17645/com.example.chatfriendly V/FA: Connecting to remote service 06-14 19:24:30.117 7781-17645/com.example.chatfriendly V/FA: Activity resumed, time: 20019705 06-14 19:24:30.206 7781-7869/com.example.chatfriendly E/EGL_emulation: tid 7869: eglSurfaceAttrib(1178): error 0x3009 (EGL_BAD_MATCH) 06-14 19:24:30.206 7781-7869/com.example.chatfriendly W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x8a15d340, error=EGL_BAD_MATCH 06-14 19:24:30.299 7781-17645/com.example.chatfriendly D/FA: Connected to remote service 06-14 19:24:30.300 7781-17645/com.example.chatwithfriendly V/FA: Processing queued up service tasks: 1 06-14 19:24:35.301 7781-17645/com.example.chatfriendly V/FA: Inactivity, disconnecting from the service