API密钥未检查元数据反应原生
创始人
2024-09-07 23:02:04
0

这通常是由于使用未经授权的API密钥引起的。为避免此错误,请确保您的API密钥已经授权并且已正确设置。您可以遵循以下步骤来解决此问题。

例子:

  1. 打开AndroidManifest.xml文件,将以下代码添加到标记之间。

  1. 打开MainApplication.java文件,并确保您已导入MetaDataAdapter库。
import io.invertase.firebase.app.ReactNativeFirebaseAppPackage;
import io.invertase.firebase.messaging.ReactNativeFirebaseMessagingPackage;
import io.invertase.firebase.notifications.ReactNativeFirebaseNotificationsPackage;
  1. 在Power II Application类的onCreate方法中添加以下代码。
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;

public class PowerIIApplication extends Application {
  @Override
  public void onCreate() {
    super.onCreate();
    FirebaseOptions options = new FirebaseOptions.Builder()
      .setApplicationId("APP_ID")
      .setApiKey("API_KEY")
      .build();
    FirebaseApp.initializeApp(context, options, "secondary");
    // ...
  }
}

请注意:您需要将“APP_ID”和“API_KEY”替换为您在Firebase控制台中设置的应用程序ID和API密钥。

  1. 在React Native中使用Google Maps时,请确保以下内容:
import { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete';

export default class MyComponent extends React.Component {
  render() {
    return(
       { 
          // 'details' is provided when fetchDetails = true
          console.log(data, details);
        }}
        query={{
          // available options: https://developers.google.com/places/web-service/autocomplete
          key: 'GOOGLE_MAPS_API_KEY',
          language: 'en', // language of the results
        }}
        styles={{
          textInputContainer: {
            width: '100%',
          },
          description: {
            fontWeight: 'bold',
          },
          predefinedPlacesDescription: {
            color: '#1faadb',
          },
        }}
        currentLocation={true}
        currentLocationLabel="Current location"
        nearbyPlacesAPI='GooglePlacesSearch'
        GoogleReverseGeocodingQuery={{}}
        GooglePlacesSearchQuery={{
          rankby: 'distance',
          types: 'food',
        }}
        predefinedPlaces={[...]}
      />
    );
  }
}

请注意:您需要将“GOOGLE_MAPS_API_KEY”替换为您在Google控制台中设置的API密钥。

相关内容

热门资讯

分享认知(拱趴大菠萝)外挂透明... 分享认知(拱趴大菠萝)外挂透明挂辅助app(智能ai代打)都是真的有挂(2022已更新)(哔哩哔哩)...
教程攻略(Aapoker)外挂... 教程攻略(Aapoker)外挂透明挂辅助软件(软件透明挂)果然真的有挂(2021已更新)(百度)1、...
玩家亲测(红龙软件德州扑克)外... 玩家亲测(红龙软件德州扑克)外挂透明挂辅助挂(智能ai代打)就是真的有挂(2020已更新)(头条)1...
发现一款(德州app)外挂透明... 发现一款(德州app)外挂透明挂辅助安装(智能ai代打)果然真的有挂(2022已更新)(今日头条)在...
技术分享(欢乐棋牌)外挂透明挂... 技术分享(欢乐棋牌)外挂透明挂辅助插件(辅助挂)一般真的有挂(2021已更新)(百度贴吧)技术分享(...
科普(governorofpo... 科普(governorofpoker3)外挂透明挂辅助器(透视)就是真的有挂(2023已更新)(百度...
玩家必看攻略(德州)外挂透明挂... 玩家必看攻略(德州)外挂透明挂辅助插件(透视)就是真的有挂(2021已更新)(今日头条);该软件可以...
今日重大通报(WEpoke)外... 今日重大通报(WEpoke)外挂透明挂辅助挂(辅助挂)好像真的有挂(2025已更新)(百度)1、该软...
热点推荐(德州app)外挂透明... 热点推荐(德州app)外挂透明挂辅助机制(软件透明挂)一贯真的有挂(2025已更新)(抖音)1、透视...
信息共享(impoker德州)... 信息共享(impoker德州)外挂透明挂辅助app(透视辅助)一直真的有挂(2022已更新)(哔哩哔...