adaptyteam / AdaptySDK-React-Native

React Native SDK for growing in-app subscriptions
https://docs.adapty.io/docs/quickstart
MIT License
122 stars 12 forks source link

adapty.getProfile return empty value in Android #75

Closed long2ice closed 1 year ago

long2ice commented 1 year ago

Description

When I success make purchase for a Google play subscription in sandbox but the return value profile is empty.

const profile = await adapty.makePurchase(product);
// google play success paied
console.log(profile);
{"accessLevels": {}, "customAttributes": {}, "nonSubscriptions": {}, "profileId": "aeeacefe-a73e-4c14-8bea-ec30d54421e3", "subscriptions": {}}

But everything for ios is fine.

BTW, I set server notifications for Apple store but not for Google play becase something wrong I can't create topic, is this the reason?

Version

v2.4.6

What platforms are you seeing the problem on?

Android

System info

System:
    OS: macOS 13.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9900KF CPU @ 3.60GHz
    Memory: 2.10 GB / 48.00 GB
    Shell: 3.6.1 - /usr/local/bin/fish
  Binaries:
    Node: 19.8.1 - ~/Library/Caches/fnm_multishells/22399_1684564541844/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.5.1 - ~/Library/Caches/fnm_multishells/22399_1684564541844/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.12.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
    Android SDK: Not Found
  IDEs:
    Android Studio: Flamingo 2022.2.1 Patch 1 Flamingo 2022.2.1 Patch 1
    Xcode: 14.1/14B47b - /usr/bin/xcodebuild
  Languages:
    Java: 14.0.2 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0 
    react-native: 0.69.6 => 0.69.6 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
divanc commented 1 year ago

Hello, @long2ice! You are right that this is most likely caused by not setting server notifications. Since Google does not notify Adapty backend that purchase has occurred, backend does not have a momentarily access to fresh data.

You can try to write to Adapty support on site about your problem, I believe they should be able to help you with RTDN

Also, refer to doc. It might have been updated since the last time you've checked

long2ice commented 1 year ago

OK, thanks! I will try that.

long2ice commented 1 year ago

Thanks! Everything works fine!