web-zkitap
TypeScript icon, indicating that this package has built-in type declarations

2.3.0 • Public • Published

react-native-webzkitap

WebZKitap mobil için geliştirilen webview uygulaması. Paket içerisinde WebZKitap için gerekli olan implementesyonlar yapılmıştır. Bunlar;

  • WebZKitap player paketini uzak sunucudan indirme
  • WebZKitap player paketini direkt olarak apk içerisinden alma
  • WebZKitap player versiyon kontrol sistemi. Versiyonlar otomatik olarak kontrol edilir ve güncelleme varsa arka planda indirir.
  • Kitap paketlerini uzak sunucudan indirme (zip olarak), ve player içerisindeki assets klasörüne kaydetme.
  • Kitap paketleri klasöre id değerine göre kaydedilir. Id değerine göre çalışır.
  • zKitabı direkt olarak web den açma ve gösterme. (Kitap paketini indirmeden açma özelliği)

Installation

npm install web-zkitap react-native-webview react-native-static-server react-native-fs react-native-zip-archive

Usage

Example: Web Player

import { WebZKitapWeb } from "web-zkitap";

const ZKitap = () => {
    // ...
    
    return (
        <WebZKitapWeb domain="https://link" bookId="12345" version="0" />
    )
}

Example: Locale Player

import { WebZKitapPlayer } from "web-zkitap";

const ZKitap = () => {
    // ...
    
    return (
        <WebZKitapPlayer bookId="12345" />
    )
}

Example: Download Book Content

import { DownloadBookContent } from "web-zkitap";

const handleDownloadClick = () => {
    // url and bookId is static. Convert static to dynamic.
    DownloadBookContent({
        url: "https://url/book-content.zip",
        bookId: "12345"
    })
    // ...
}

Example: Check up to date WebZKitap Player

import { DownloadZKitapPlayer } from "web-zkitap";

const handleDownloadClick = () => {
    // Domain is static. Convert static to dynamic.
    DownloadZKitapPlayer({domain: "https://url/WebZKitap.zip"})
    .then(() => {
        console.log("Güncellendi.")
    })
    .catch(err => {
        console.log("HATA:", err)
    })
    // ...
}

Example: Remove Book Assets

import { RemoveBookAssets } from "web-zkitap";

const handleRemoveBookClick = () => {
    // Domain is static. Convert static to dynamic.
    RemoveBookAssets({bookId: "12345"})
    .then(() => {
        console.log("Kitap silindi.")
    })
    .catch(err => {
        console.log("HATA:", err)
    })
    // ...
}

License

MIT


Author: Yasin Torun

Package Sidebar

Install

npm i web-zkitap

Weekly Downloads

2

Version

2.3.0

License

MIT

Unpacked Size

98.4 kB

Total Files

44

Last publish

Collaborators

  • yasintorun
  • aaozcann