@@ -72,12 +72,21 @@ public class MethodCallHandlerImpl implements MethodCallHandler, ActivityResultL
7272 hmsLogger = HMSLogger .getInstance (mActivity .getApplicationContext ());
7373 }
7474
75- private void isEnvReady (@ NonNull final Result result ) {
75+ private void isEnvReady (@ NonNull final MethodCall call , @ NonNull final Result result ) {
7676 final String isEnvReadyMethodName = "isEnvReady" ;
77+ final Boolean isSupportAppTouch = call .argument ("isSupportAppTouch" ) == null
78+ ? null
79+ : ValueGetter .getBoolean ("isSupportAppTouch" , call );
7780 hmsLogger .startMethodExecutionTimer (isEnvReadyMethodName );
78- mIapClient .isEnvReady ()
79- .addOnSuccessListener (new DefaultSuccessListener <>(result , mGson , hmsLogger , isEnvReadyMethodName ))
80- .addOnFailureListener (new IsEnvReadyFailureListener (this , result , REQUEST_IS_ENVIRONMENT_READY , hmsLogger ));
81+ if (isSupportAppTouch == null ) {
82+ mIapClient .isEnvReady ()
83+ .addOnSuccessListener (new DefaultSuccessListener <>(result , mGson , hmsLogger , isEnvReadyMethodName ))
84+ .addOnFailureListener (new IsEnvReadyFailureListener (this , result , REQUEST_IS_ENVIRONMENT_READY , hmsLogger ));
85+ } else {
86+ mIapClient .isEnvReady (isSupportAppTouch )
87+ .addOnSuccessListener (new DefaultSuccessListener <>(result , mGson , hmsLogger , isEnvReadyMethodName ))
88+ .addOnFailureListener (new IsEnvReadyFailureListener (this , result , REQUEST_IS_ENVIRONMENT_READY , hmsLogger ));
89+ }
8190 }
8291
8392 private void isSandboxActivated (@ NonNull final Result result ) {
@@ -119,13 +128,17 @@ private void createPurchaseIntent(@NonNull final MethodCall call, @NonNull final
119128 final String reservedInfor = call .argument ("reservedInfor" ) == null
120129 ? null
121130 : ValueGetter .getString ("reservedInfor" , call );
131+ final String signatureAlgorithm = call .argument ("signatureAlgorithm" ) == null
132+ ? null
133+ : ValueGetter .getString ("signatureAlgorithm" , call );
122134
123135 //Constructing request
124136 final PurchaseIntentReq request = new PurchaseIntentReq ();
125137 request .setProductId (productId );
126138 request .setPriceType (priceType );
127139 request .setDeveloperPayload (developerPayload );
128140 request .setReservedInfor (reservedInfor );
141+ request .setSignatureAlgorithm (signatureAlgorithm );
129142
130143 //Create purchase intent from IAP service
131144 final String createPurchaseIntentMethodName = "createPurchaseIntent" ;
@@ -144,11 +157,15 @@ private void consumeOwnedPurchase(@NonNull final MethodCall call, @NonNull final
144157 final String developerChallenge = call .argument ("developerChallenge" ) == null
145158 ? null
146159 : ValueGetter .getString ("developerChallenge" , call );
160+ final String signatureAlgorithm = call .argument ("signatureAlgorithm" ) == null
161+ ? null
162+ : ValueGetter .getString ("signatureAlgorithm" , call );
147163
148164 //Constructing request
149165 final ConsumeOwnedPurchaseReq request = new ConsumeOwnedPurchaseReq ();
150166 request .setDeveloperChallenge (developerChallenge );
151167 request .setPurchaseToken (purchaseToken );
168+ request .setSignatureAlgorithm (signatureAlgorithm );
152169
153170 // Call service from IAP service
154171 final String consumeOwnedPurchaseMethodName = "consumeOwnedPurchase" ;
@@ -164,6 +181,9 @@ private void consumeOwnedPurchase(@NonNull final MethodCall call, @NonNull final
164181 private void obtainOwnedPurchaseRecord (@ NonNull final MethodCall call , @ NonNull final Result result ) {
165182 //Arguments
166183 final int priceType = ValueGetter .getInt ("priceType" , call );
184+ final String signatureAlgorithm = call .argument ("signatureAlgorithm" ) == null
185+ ? null
186+ : ValueGetter .getString ("signatureAlgorithm" , call );
167187 final String continuationToken = call .argument ("continuationToken" ) == null
168188 ? null
169189 : ValueGetter .getString ("continuationToken" , call );
@@ -172,6 +192,7 @@ private void obtainOwnedPurchaseRecord(@NonNull final MethodCall call, @NonNull
172192 final OwnedPurchasesReq request = new OwnedPurchasesReq ();
173193 request .setContinuationToken (continuationToken );
174194 request .setPriceType (priceType );
195+ request .setSignatureAlgorithm (signatureAlgorithm );
175196
176197 //Obtain record from IAP service
177198 final String obtainOwnedPurchaseRecordMethodName = "obtainOwnedPurchaseRecord" ;
@@ -190,11 +211,15 @@ private void obtainOwnedPurchases(@NonNull final MethodCall call, @NonNull final
190211 final String continuationToken = call .argument ("continuationToken" ) == null
191212 ? null
192213 : ValueGetter .getString ("continuationToken" , call );
214+ final String signatureAlgorithm = call .argument ("signatureAlgorithm" ) == null
215+ ? null
216+ : ValueGetter .getString ("signatureAlgorithm" , call );
193217
194218 //Constructing request
195219 final OwnedPurchasesReq request = new OwnedPurchasesReq ();
196220 request .setContinuationToken (continuationToken );
197221 request .setPriceType (priceType );
222+ request .setSignatureAlgorithm (signatureAlgorithm );
198223
199224 //Obtain owned purchase from IAP service
200225 final String obtainOwnedPurchasesMethodName = "obtainOwnedPurchases" ;
@@ -231,7 +256,7 @@ private void startIapActivity(@NonNull final MethodCall call, final Result resul
231256 public void onMethodCall (@ NonNull final MethodCall call , @ NonNull final Result result ) {
232257 switch (call .method ) {
233258 case "isEnvReady" :
234- isEnvReady (result );
259+ isEnvReady (call , result );
235260 break ;
236261 case "isSandboxActivated" :
237262 isSandboxActivated (result );
0 commit comments