npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@devsomersets/react-native-rustore-iap

v1.3.0

Published

test

Downloads

10

Readme

React Native RuStore IAP

Данная библиотека является оберткой над RuStore SDK

Установка

npm install @devsomersets/react-native-rustore-iap
android/build.gradle

allprojects {
    repositories {
        ...
        maven {
            url("https://artifactory-external.vkpartner.ru/artifactory/maven")
        }
    }
}

android/app/build.gradle

dependencies {
    ...
    implementation("ru.rustore.sdk:billingclient:1.1.1")
}

При разработке локально дебаг билд нужно подписывать тем кейстором, который использовался при загрузке приложения в RuStore Console.

Для корректной установки pod'ов нужно установить зависимость в modular_headers => false

pod 'react-native-rustore-iap', :podspec => '../node_modules/react-native-rustore-iap/react-native-rustore-iap.podspec', :modular_headers => false

Expo plugin

Поддержка Managed проектов Expo c expo-config-plugin

app.json
...
"plugins": [
      ["@devsomersets/react-native-rustore-iap"],
      ["expo-build-properties",
      {
        "android": {
          "minSdkVersion": 23
        }
      }
    ]],
...

Проверка доступности работы с платежами

Для проверки доступности платежей вызовите метод checkRuStorePurchasesAvailability.

При его вызове проверяются следующие условия:

  1. На устройстве пользователя должен быть установлен RuStore.

  2. RuStore должен поддерживать функциональность платежей.

  3. Пользователь должен быть авторизован в RuStore.

  4. Пользователь и приложение не должны быть заблокированы в RuStore.

  5. Для приложения должна быть включена возможность покупок в системе RuStore Консоль.

Использование

import { initializeRuStore, checkRuStoreAvailable } from '@devsomersets/react-native-rustore-iap';
import { useEffect } from 'react';
import { View } from 'react-native';

const YOUR_APP_ID: string = "YOUR_RUSTORE_CONSOLE_APP_ID";

function App() {
  useEffect(() => {
    initializeRuStore(YOUR_APP_ID);
    checkRuStoreAvailable().then((isAvailable) => {
      if (typeof isAvailable === "string") {
        // handle error
        // (https://help.rustore.ru/rustore/for_developers/developer-documentation/sdk_payments/SDK-connecting-payments/Error-processing)
      } else {
        // isAvailable will be true
      }
    })

  }, []);

  return <View />;
}

Инициализация модуля

import { initializeRuStore } from '@devsomersets/react-native-rustore-iap';

initializeRuStore(YOUR_CONSOLE_APP_ID);

Проверка доступности работы

import { checkRuStoreAvailable } from '@devsomersets/react-native-rustore-iap';

const isRuStoreAvailable: Boolean | String = await checkRuStoreAvailable();

Обработка ошибок (https://help.rustore.ru/rustore/for_developers/developer-documentation/sdk_payments/SDK-connecting-payments/Error-processing)

Получение актуальной информации по списку продуктов

Для получения списка продуктов используйте метод getProducts:

import { getRuStoreProducts } from '@devsomersets/react-native-rustore-iap';

const products: RuStoreProduct[] = await getRuStoreProducts(productsIds: String[]);

Получение списка покупок пользователя

import { getRuStorePurchases } from '@devsomersets/react-native-rustore-iap';

const products: RuStorePurchase[] = await getRuStorePurchases();

Покупка продукта

import { purchaseRuStoreProduct } from '@devsomersets/react-native-rustore-iap';

const purchaseResult: PaymentResult | InvalidPurchaseResult = await purchaseRuStoreProduct(product: RuStoreProduct, developerPayload?: string);

Потребление покупки

import { confirmRuStorePurchase } from '@devsomersets/react-native-rustore-iap';

const confirmResponse: ConfirmPurchaseResponse = await confirmRuStorePurchase(purchaseId: string, developerPayload?: string);

Отмена покупки

import { deleteRuStorePurchase } from '@devsomersets/react-native-rustore-iap';

const deletePurchaseResponse: DeletePurchaseResponse = await deleteRuStorePurchase(purchaseId: string);

Сценарий потребления и отмены покупки

https://help.rustore.ru/rustore/for_developers/developer-documentation/sdk_payments/SDK-connecting-payments/%20consumption-and-withdrawal

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library