Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt Purchasing supports Subscriptions on Android?
Forum Updated to NodeBB v4.3 + New Features

Qt Purchasing supports Subscriptions on Android?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
22 Posts 8 Posters 5.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hjpriester1967
    wrote on 10 Jan 2019, 08:21 last edited by
    #3

    Subscription on Android are not supported. I experimented with it last month.
    See qtbug https://bugreports.qt.io/browse/QTBUG-49606

    It is possible to hack around it but best would it Qt Purchase add the Subscription support of all mobile platforms .
    (file: qt-purchase-hack.tar contains my changes)

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Vitaliy
      wrote on 11 Jan 2019, 07:19 last edited by Vitaliy 1 Nov 2019, 08:02
      #4

      Thanks. The best example I see is using java inserts, for example https://github.com/eskilblomfeldt/qthangman and http://blog.qt.io/blog/2013/12/12/implementing-in-app-purchase-on-android/.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hjpriester1967
        wrote on 11 Jan 2019, 09:21 last edited by
        #5

        I believe the blog describes the source as it was in 2013. It it slightly changed now in Qt 5.9.7. (that was the version I was looking at).

        The problem is in the Qt Java code there is a call: getSkuDetails where there the 3th parameter is always 'inapp'. this parameter needs to be 'subs' for subscription.
        So if you have need to support for subscription ONLY is it easy to hack....if you need to support both you need to do much more. At API level you have to pass the type and modify c++ and java code.

        In my hack: If a product does not exist as an normal 'inapp' type I check if it exist as a 'subs' type and the this type is stored (internally). when doing a purchase I pass the type.

        P 1 Reply Last reply 26 Feb 2019, 13:42
        0
        • V Offline
          V Offline
          Vitaliy
          wrote on 16 Jan 2019, 09:20 last edited by Vitaliy
          #6

          I use https://github.com/eskilblomfeldt/qthangman for example java and Qt C++ interaction. For purchases using this library https://github.com/anjlab/android-inapp-billing-v3. Works great.

          1 Reply Last reply
          2
          • M Offline
            M Offline
            morte
            wrote on 27 Jan 2019, 11:03 last edited by
            #7

            Suggestion about Subscriptions https://bugreports.qt.io/browse/QTBUG-49606 opened 3 years ago and still not implemented, im wondering why this important thing which looks like don't need much effort to implement still not fixed

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 27 Jan 2019, 21:40 last edited by
              #8

              @morte Because there are so many people working on Qt and tasks have to be prioritise. All the things that "looks like not much effort" still needs proper implementation, tests, etc. So it's rarely that "not much effort" regarding such a feature. However, contributions are always welcome and help get features faster in.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2
              • H hjpriester1967
                11 Jan 2019, 09:21

                I believe the blog describes the source as it was in 2013. It it slightly changed now in Qt 5.9.7. (that was the version I was looking at).

                The problem is in the Qt Java code there is a call: getSkuDetails where there the 3th parameter is always 'inapp'. this parameter needs to be 'subs' for subscription.
                So if you have need to support for subscription ONLY is it easy to hack....if you need to support both you need to do much more. At API level you have to pass the type and modify c++ and java code.

                In my hack: If a product does not exist as an normal 'inapp' type I check if it exist as a 'subs' type and the this type is stored (internally). when doing a purchase I pass the type.

                P Offline
                P Offline
                PowerNow
                wrote on 26 Feb 2019, 13:42 last edited by PowerNow
                #9

                @hjpriester1967: I just did the "static test" with the product-id "android.test.purchased" from google billing and it worked fine. Now I tried it with my own product-id from a subscription and I got the message "...unregistered product". So I wanted to modify the QtInAppPurchase.java file and replace "inapp" with "subs" because I only need subscriptions. But this file does not exist in the Qt5.12 folder. I also greped for "getSkuDetails". Now it seems so that this file is archived under the executable root\android_armv7\jar\QtPurchasing.jar. Is there a way to change such files or an other easier way? Thxs...

                H 1 Reply Last reply 28 Feb 2019, 13:15
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 26 Feb 2019, 20:32 last edited by
                  #10

                  You need to grab the QtPurchasing module sources to get that file.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  P 1 Reply Last reply 27 Feb 2019, 07:18
                  0
                  • S SGaist
                    26 Feb 2019, 20:32

                    You need to grab the QtPurchasing module sources to get that file.

                    P Offline
                    P Offline
                    PowerNow
                    wrote on 27 Feb 2019, 07:18 last edited by PowerNow
                    #11

                    @SGaist: Thxs, but what do you exactly mean with grab? As I know now .jar can't be changed. So the "easiest" way would be to modify QTInAppPurchasing.java from the original modul

                    http://code.qt.io/cgit/qt/qtpurchasing.git/tree/src/android/src

                    and create a new .jar file. But I have no experience creating executable .jar files.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 27 Feb 2019, 21:06 last edited by
                      #12

                      Looks like you would have to build the module.

                      You can open it in Qt Creator and build it from there. Then copy the resulting .jar file in your official Qt installation (don't forget to make a backup of the original file just in case).

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      P 1 Reply Last reply 1 Mar 2019, 09:11
                      0
                      • P PowerNow
                        26 Feb 2019, 13:42

                        @hjpriester1967: I just did the "static test" with the product-id "android.test.purchased" from google billing and it worked fine. Now I tried it with my own product-id from a subscription and I got the message "...unregistered product". So I wanted to modify the QtInAppPurchase.java file and replace "inapp" with "subs" because I only need subscriptions. But this file does not exist in the Qt5.12 folder. I also greped for "getSkuDetails". Now it seems so that this file is archived under the executable root\android_armv7\jar\QtPurchasing.jar. Is there a way to change such files or an other easier way? Thxs...

                        H Offline
                        H Offline
                        hjpriester1967
                        wrote on 28 Feb 2019, 13:15 last edited by
                        #13

                        @PowerNow I have only looked at Qt 5.9 for the subscription and not at Qt 5.12. My boss decided to put using subscription on Android on hold in the apps for now so I am not using it anymore at the moment.

                        P 1 Reply Last reply 1 Mar 2019, 07:37
                        0
                        • H hjpriester1967
                          28 Feb 2019, 13:15

                          @PowerNow I have only looked at Qt 5.9 for the subscription and not at Qt 5.12. My boss decided to put using subscription on Android on hold in the apps for now so I am not using it anymore at the moment.

                          P Offline
                          P Offline
                          PowerNow
                          wrote on 1 Mar 2019, 07:37 last edited by
                          #14

                          @hjpriester1967 Was it also necessary to create a .jar file at Qt5.9?

                          1 Reply Last reply
                          0
                          • S SGaist
                            27 Feb 2019, 21:06

                            Looks like you would have to build the module.

                            You can open it in Qt Creator and build it from there. Then copy the resulting .jar file in your official Qt installation (don't forget to make a backup of the original file just in case).

                            P Offline
                            P Offline
                            PowerNow
                            wrote on 1 Mar 2019, 09:11 last edited by
                            #15

                            @SGaist: This sounds good.

                            1. How can I completely (incl. the subdir structur) load the QtPurchase modul into Qt Creator?
                              http://code.qt.io/cgit/qt/qtpurchasing.git/tree/src/android/src?h=5.9
                            2. Then, how create a .jar file?
                              Thxs...
                            1 Reply Last reply
                            0
                            • H Offline
                              H Offline
                              hjpriester1967
                              wrote on 1 Mar 2019, 09:30 last edited by
                              #16

                              @Powernow: I always use Qt source tar and compile Qt my self. I see you use the precompiled version. The qtpurchasing is subdirectory and the java files are in that tree. The jar files are creating during the make...and after make install these are in the jar subdirectory of the qt installation tree.

                              P 1 Reply Last reply 1 Mar 2019, 11:29
                              0
                              • H hjpriester1967
                                1 Mar 2019, 09:30

                                @Powernow: I always use Qt source tar and compile Qt my self. I see you use the precompiled version. The qtpurchasing is subdirectory and the java files are in that tree. The jar files are creating during the make...and after make install these are in the jar subdirectory of the qt installation tree.

                                P Offline
                                P Offline
                                PowerNow
                                wrote on 1 Mar 2019, 11:29 last edited by
                                #17

                                @hjpriester1967 So maybe I will also try to compile Qt myself. Thxs...

                                Another question, as you are using subsriptions.

                                https://developer.android.com/google/play/billing/api
                                Because the Google Play client now caches In-app Billing information locally on the device, you can use the In-app Billing API to query for this information more frequently.

                                If someone unstall/install the app. Do you check e.g. the timestamp from the subscription via the Googles local cashed with getBuyIntent()?

                                https://forum.qt.io/topic/100193/check-consumable-inapppurchase-on-android-after-app-reinstall

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on 1 Mar 2019, 19:34 last edited by
                                  #18

                                  No need for a complete Qt build. Just the module you are interested in.

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  0
                                  • H Offline
                                    H Offline
                                    h00bs
                                    wrote on 24 May 2019, 10:26 last edited by h00bs
                                    #19

                                    There is a Qt plugin for in-app purchase subscriptions on iOS and Android available with Felgo: https://felgo.com/updates/release-3-2-0-qt-5-12-3-subscriptions

                                    Developer at Felgo - https://felgo.com/qt

                                    Develop mobile Apps for iOS & Android with Qt
                                    Develop Games with Qt

                                    Felgo is an official Qt Technology Partner

                                    1 Reply Last reply
                                    0
                                    • G Offline
                                      G Offline
                                      Gourmet
                                      wrote on 14 Apr 2020, 12:17 last edited by Gourmet
                                      #20

                                      up

                                      Any news about this issue? I strongly need in-app subscription for my new Qt5 based Android app. Is there straight and well documented way to implement this?

                                      mrjjM 1 Reply Last reply 14 Apr 2020, 12:37
                                      0
                                      • G Gourmet
                                        14 Apr 2020, 12:17

                                        up

                                        Any news about this issue? I strongly need in-app subscription for my new Qt5 based Android app. Is there straight and well documented way to implement this?

                                        mrjjM Offline
                                        mrjjM Offline
                                        mrjj
                                        Lifetime Qt Champion
                                        wrote on 14 Apr 2020, 12:37 last edited by
                                        #21

                                        @Gourmet
                                        Hi
                                        It seems the path was canceled "Harald Meyer Abandoned" so I don't think
                                        its included or planned for any new releases.

                                        G 1 Reply Last reply 15 Apr 2020, 15:23
                                        0
                                        • mrjjM mrjj
                                          14 Apr 2020, 12:37

                                          @Gourmet
                                          Hi
                                          It seems the path was canceled "Harald Meyer Abandoned" so I don't think
                                          its included or planned for any new releases.

                                          G Offline
                                          G Offline
                                          Gourmet
                                          wrote on 15 Apr 2020, 15:23 last edited by
                                          #22

                                          @mrjj but something changed today and yesterday in QTBUG-49606...

                                          1 Reply Last reply
                                          1

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved