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
package com.maple.kashin.learning | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import android.text.Html | |
import android.util.Log | |
import android.widget.Toast | |
import com.maple.kashin.databinding.ActivityChapterInfoBinding | |
import com.maple.kashin.learning.models.ChapterInfo | |
import com.maple.kashin.learning.models.QuranicChapterInfoResponseModel |
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
create a new project in firebse website | |
set firestore | |
set authentication | |
create a collection in firestore | |
firestore rules change read and write permission | |
------------------------------------------------ | |
go to react application | |
npm install firebase |
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
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}); | |
async function fetchImage(id, type = 'maxresdefault') { | |
const req = await fetch(`https://i.ytimg.com/vi/${id}/${type}.jpg`); | |
if (req.status != 200) return await fetchImage(id, 'hqdefault'); | |
return req; | |
}; |