我正在尝试将FCM集成到Android项目中,因为它是用Firebase文档编写的.
我的应用程序的gradle:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
...
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:support-v4:20.0.0'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-config:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.0.2'
compile 'com.google.firebase:firebase-crash:9.2.0'
compile 'com.google.android.gms:play-services-ads:9.2.0'
compile 'com.google.android.gms:play-services-analytics:9.2.0'
compile 'com.google.android.gms:play-services-games:9.2.0'
}
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
的Manifest.xml:
<service
android:name=".MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
Run Code Online (Sandbox Code Playgroud)
和MyFirebaseMesagingService:
public class MyFirebaseMessagingService extends FirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.i("info", "From: " + remoteMessage.getFrom());
Log.i("info", "Notification Message Body: " + remoteMessage.getNotification().getBody());
}
Run Code Online (Sandbox Code Playgroud)
}
但是当我发送推送时,我得到的是:
java.lang.NoSuchMethodError: com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzUr
at com.google.firebase.messaging.FirebaseMessagingService.zzz(Unknown Source)
at com.google.firebase.iid.zzb.onStartCommand(Unknown Source) …Run Code Online (Sandbox Code Playgroud) 我正在尝试启动.Net Core 2.0应用程序Ubuntu 17.04.我以前在Windows 10上开发它并且运行良好.问题是,当我运行时,dotnet ef database update我得到下一个异常:
System.PlatformNotSupportedException: LocalDB is not supported on this Platform.
Run Code Online (Sandbox Code Playgroud)
这是我的DbContext:
public class NutritionContext : DbContext
{
public DbSet<User> Users { get; set; }
public DbSet<Meal> Meals { get; set; }
public DbSet<Dish> Dishes { get; set; }
public DbSet<Product> Products { get; set; }
public DbSet<Plan> Plans { get; set; }
public DbSet<MealDish> MealDishes { get; set; }
public DbSet<Ingredient> Ingredients { get; set; } …Run Code Online (Sandbox Code Playgroud) 我正在尝试通过将开发人员模式设置为发布模式来设置firebase远程配置false.但是,如果缓存到期时间小于3000(可能会少一点,通过实验确定)秒,则无法获取数据.它抛出FirebaseRemoteConfigFetchThrottledException
FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
.setDeveloperModeEnabled(false)
.build();
Run Code Online (Sandbox Code Playgroud)
并且.setDeveloperModeEnabled(true)它允许我设置任何时间甚至0并且运行良好.
这是整个大块头:
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
.setDeveloperModeEnabled(false)
.build();
mFirebaseRemoteConfig.setConfigSettings(configSettings);
mFirebaseRemoteConfig.setDefaults(R.xml.remote_config_defaults);
mFirebaseRemoteConfig.fetch(CACHE_EXPIRATION)
.addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Log.i("info32", "remote config succeeded");
mFirebaseRemoteConfig.activateFetched();
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
Log.i("info32", "remote config failed");
}
});
}
}, 0);
Run Code Online (Sandbox Code Playgroud)
你能解释一下这是什么问题吗?
我有一个安装了Fabric Crashytics的android应用。我遵循官方指南来设置Firebase Crashlytics,并关联了Fabric和Firebase帐户(AFAIK Firebase最近收购了Fabric)。因此,特别是我删除了Fabric带有<meta-data/>标签的API密钥manifest.xml。
然后,我尝试进行测试崩溃,但是Firebase和Fabric仪表板中都没有出现该崩溃,但是我在logcat:中获得了成功登录Crashlytics report upload complete: <ID>。
当我嗅探网络时,似乎是403 Unathorized从Crashlytics 获得。但是,当我Fabric在<meta-data/>标记中添加API密钥时,它可以工作,并且我看到崩溃报告。
帮我请问我的配置有什么问题,API key如果我使用的是新的Firebase Crashlytics ,为什么我需要使用旧的Fabric ,而文档却没有说明。
当我们通过设计器为视图创建约束时,它会自动为此约束创建边距 - 8dp。在很多情况下我不需要那个边距,所以我必须手动删除它(或更改为0dp)。
有没有办法可以为 中的约束自定义默认边距ConstraintLayout?
目标是在谷歌地图上显示大量数据。大量我的意思是存储在 PostgreSQL 数据库中的大约 1000 万个段。线段代表道路的一些特征,因此线段应该覆盖在底图中的道路上。段属性可能会随着时间而改变。
这个问题最好的技术解决方案是使用自定义的tile server(如有错误请指正)。
根据 Google Maps JS API,我发现了两种使用自定义图块服务器绘制地图的方法:
我都试过了。第一个不符合我的需求,因为 GeoJson 显得太大,导致性能问题。从用户体验的角度来看,第二个是不好的,因为它使用的是光栅图块,而现在我们应该使用矢量图块。我还查看了 OpenLayers / Leaflet,但没有找到使用 Google 地图的官方方法(请参阅https://github.com/mapbox/mapbox-gl-js/issues/1791)。
这里的关键是使用矢量切片,但是我无法在 Google 地图上渲染矢量切片 (MVT)。
有什么方法可以在 Google Maps Platform 上渲染矢量切片?
android ×4
firebase ×3
.net-core ×1
c# ×1
crashlytics ×1
database ×1
gis ×1
google-maps ×1
mapbox-gl ×1