gpt4 book ai didi

android - AppsFlyer 返回状态码 400

转载 作者:太空狗 更新时间:2023-10-29 14:53:25 26 4
gpt4 key购买 nike

我为我的示例项目实现了 Appsflyer,但是当我运行它时,服务器返回错误代码 400。

I/AppsFlyer_1.18-117182240: response code: 400

这是我的 MainActivty.java

public class MainActivity extends AppCompatActivity {

public static final String LOG_TAG = "AppsFlyerSampleApp";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
// Set the Currency
AppsFlyerLib.setCurrencyCode("USD");

// The Dev key cab be set here or in the manifest.xml
AppsFlyerLib.setAppsFlyerKey("aaaa");
AppsFlyerLib.sendTracking(this);

AppsFlyerLib.registerConversionListener(this, new AppsFlyerConversionListener() {
public void onInstallConversionDataLoaded(Map<String, String> conversionData) {
DebugLogQueue.getInstance().push("\nGot conversion data from server");
for (String attrName : conversionData.keySet()) {
Log.d(LOG_TAG, "attribute: " + attrName + " = " + conversionData.get(attrName));
}
}

public void onInstallConversionFailure(String errorMessage) {
Log.d(LOG_TAG, "error getting conversion data: " + errorMessage);
}

public void onAppOpenAttribution(Map<String, String> attributionData) {
printMap(attributionData);
}

public void onAttributionFailure(String errorMessage) {
Log.d(LOG_TAG, "error onAttributionFailure : " + errorMessage);

}

private void printMap(Map<String, String> map) {
for (String key : map.keySet()) {
Log.d(LOG_TAG, key + "=" + map.get(key));
}

}
});
}

还有我的 list 文件。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.afapplication">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="appsflyer" />
<!--<data android:scheme="http"-->
<!--android:host="sometest.com" />-->
</intent-filter>
</activity>

<receiver
android:name="com.appsflyer.MultipleInstallBroadcastReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<receiver android:name="com.appsflyer.AppsFlyerLib">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
</application>

不知道为什么服务器会输出错误码400?
有没有其他人有类似的情况?

最佳答案

我认为您应该检查您的 applicationId 并确保您在 Appsflyer 控制面板中使用相同的 applicationId 创建了您的应用。

我有相同的错误代码,直到我在 Appsflyer 上创建我的测试应用时输入的 applicationId 中发现了拼写错误...

希望对你有帮助

关于android - AppsFlyer 返回状态码 400,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33412955/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com