2012-08-24 2 views
5

こんにちは、このアプリをinApp Billingで市場にリリースしました。私たちのログによれば、BillingService(おそらくアプリ自体)は特定の顧客のデバイスで非常にランダムにゲッティングを殺しています。このため、購入が成功したかどうか通知を受け取ることができないことがあります。顧客の中には、購入を成功させるために2回購入することがよくあります。これはごく一部のお客様に起こりますが、非常に困っています。何が起こっているのか、あるいはこの問題を回避するために何ができるのか。In App課金サービスが時々殺される

+1

このプロセスではどこが殺されるのでしょうか?通常、Androidマーケットのブロードキャスト通知 - >お客様のBillingReceiver onReceived() - > BillingReceiverから購入したインテントをBillingService - > BillingServiceハンドルに送信し、購入した情報を更新します。 –

+0

事はかなりランダムで、私はまだこの問題を私のデバイスで再現しています。それは少数のユーザーに起こりますが、とにかく修正したいと考えています。 – the100rabh

+0

ランダム性がそれをはるかに難しくしています:)あなたは、アプリに追跡情報を追加することはできますか? Acraは私が有用だと思うエラートラッキングツールです。また、積極的なタスクキラーアプリでもあります。 –

答えて

0

アプリ内課金に使用するコードを公開することはできますか? Androidマーケットブロードキャスト通知にアクセスしようとすると、アプリ内課金が端末でサポートされていないか、インターネット接続が失われている可能性があります。私は私のアプリで使用することは、このように基本的には次のとおりです。次に

@Override 
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { 
if(BillingHelper.isBillingSupported()){ 
     switch (arg2) { 
     case 0:   
      Log.d("Appname", "30 coins"); 
      BillingHelper.requestPurchase(context, "com.paid.smallcoinbundle"); 
       break; 
     case 1: 
      Log.d("Appname", "85 coins"); 
      BillingHelper.requestPurchase(context, "com.paid.medcoinbundle"); 
       break; 
     case 2: 
      Log.d("Appname", "175 coins"); 
      BillingHelper.requestPurchase(context, "com.paid.midcoinbundle"); 
       break; 
     case 3: 
      Log.d("Appname", "500 coins"); 
      BillingHelper.requestPurchase(context, "com.paid.maxcoinbundle"); 
       break; 
     default: Log.d("Appname", "Something broke"); 
     break; 
     } 
    // BillingHelper.requestPurchase(mContext, "android.test.purchased"); 
     // android.test.purchased or android.test.canceled or android.test.refunded or com.blundell.item.passport 
    } else { 
     LayoutInflater inflater = getLayoutInflater(); 
     View layout = inflater.inflate(R.layout.toast_layout,(ViewGroup) findViewById(R.id.toast_layout_root)); 
     TextView text = (TextView) layout.findViewById(R.id.text); 
     text.setText("In App Billing isnt supported by your device"); 
     Toast toast = new Toast(getBaseContext()); 
     toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0); 
     toast.setDuration(Toast.LENGTH_LONG); 
     toast.setView(layout); 
     toast.show(); 
     return; 
    } 
} 

public Handler mTransactionHandler = new Handler(){ 
    public void handleMessage(android.os.Message msg) { 
     Log.d("Appname", "Transaction complete"); 
     Log.d("Appname", "Transaction status: "+BillingHelper.latestPurchase.purchaseState); 
     Log.d("Appname", "Item purchased is: "+BillingHelper.latestPurchase.productId); 

     if(BillingHelper.latestPurchase.isPurchased()){ 
      Log.d("Appname", "Ispurchased : " + BillingHelper.latestPurchase.productId); 
      if(BillingHelper.latestPurchase.productId.equals("com.paid.smallcoinbundle")){ 
       ConnectToServer.UpdateCoins(context,id,"add","30"); 
      } 
      if(BillingHelper.latestPurchase.productId.equals("com.paid.medcoinbundle")){ 
       ConnectToServer.UpdateCoins(context,id,"add","85"); 
      } 
      if(BillingHelper.latestPurchase.productId.equals("com..paid.midcoinbundle")){ 
       ConnectToServer.UpdateCoins(context,id,"add","175"); 
      } 
      if(BillingHelper.latestPurchase.productId.equals("com.paid.maxcoinbundle")){ 
       ConnectToServer.UpdateCoins(context,id,"add","500"); 
      } 

      finish(); 
     } 
    }; 

};

アプリの請求では機能しないと言われたので、商品を2回購入する必要があることもありますが、パッケージ名が正しいと思われます。

問題を修正して問題が何かを知りたい場合は教えてください。これは非常に興味深いトピックです。

+0

これは本当に面白いです、コードはGoogleのサンプルコードから直接選んだものです。それはほとんどのユーザーにとって完璧に機能します。彼らのほんの一人がこの問題を経験します。 – the100rabh

+0

その場合はおそらくシステムのバグでしょう。開発チームにバグ報告を書いてください。私はあなたを助けることができなかったことを申し訳ありません。 –

+0

こんにちはランディー、私を助けてくれてありがとう:) – the100rabh

2

私はそれが役立つかどうかわからないが、私はあなたのBillingServiceのフォアグラウンドサービスを作ることをお勧めします:ここでhttp://developer.android.com/guide/components/services.html#Foreground

は、システムが考慮フォアグラウンド状態でサービスを配置するドキュメント 「APIの一部ですそれはユーザーが積極的に認識しているものであり、メモリが不足している場合には殺害の候補とはなりません」。

ユーザーの中にはメモリ状態が低く、サービス/アプリケーション)。

+0

ええ、ウル右メモリについて。それは私の推測だけど。しかし、それを前景のプロセスにすることは、実際には良い示唆です。これは役に立ちます。しかし、実際には、サービス全体だけでなく、プロセス全体が再起動しているようです。 – the100rabh

+0

その時点でフォアグラウンドの活動(またはサービス)がない場合、システムはメモリ不足の状態でプロセス全体を強制終了させる可能性があります。 –

関連する問題