Application name is not set. Call Builder#setApplicationName. error

后端 未结 2 637
旧巷少年郎
旧巷少年郎 2021-02-12 15:49

Application: Connecting to BigQuery using BigQuery APIs for Java Environment: Eclipse, Windows 7

My application was running fine until last night. I\'ve made no changes

相关标签:
2条回答
  • 2021-02-12 16:26

    Try this to set your application name

    Drive service = new Drive.Builder(httpTransport, jsonFactory, null)
                      .setHttpRequestInitializer(credential)
                      .setApplicationName("Your app name")
                      .build();
    
    0 讨论(0)
  • 2021-02-12 16:37

    If you are working with only Firebase Dynamic Links without Android or iOS app

    Try this. builder.setApplicationName(firebaseUtil.getApplicationName());

    FirebaseUtil is custom class add keys and application name to this class

    FirebaseDynamicLinks.Builder builder = new FirebaseDynamicLinks.Builder(
                        GoogleNetHttpTransport.newTrustedTransport(), JacksonFactory.getDefaultInstance(), null);
    
        // initialize with api key
    FirebaseDynamicLinksRequestInitializer firebaseDynamicLinksRequestInitializer = new FirebaseDynamicLinksRequestInitializer(
                        firebaseUtil.getFirebaseApiKey());
    builder.setFirebaseDynamicLinksRequestInitializer(firebaseDynamicLinksRequestInitializer);
    builder.setApplicationName(firebaseUtil.getApplicationName());
    // build dynamic links
    FirebaseDynamicLinks firebasedynamiclinks = builder.build();
    
    // create Firebase Dynamic Links request
    CreateShortDynamicLinkRequest createShortLinkRequest = new CreateShortDynamicLinkRequest();
                createShortLinkRequest.setLongDynamicLink(firebaseUtil.getFirebaseUrlPrefix() + "?link=" + urlToShorten);
    Suffix suffix = new Suffix();
    suffix.setOption(firebaseUtil.getShortSuffixOption());
    createShortLinkRequest.setSuffix(suffix);
    
    // request short url
    FirebaseDynamicLinks.ShortLinks.Create request = firebasedynamiclinks.shortLinks()
                        .create(createShortLinkRequest);
    CreateShortDynamicLinkResponse createShortDynamicLinkResponse = request.execute();  
    
    0 讨论(0)
提交回复
热议问题