Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
212 views
in Technique[技术] by (71.8m points)

What is the purpose of "setApplicationName" in the Google APIs Java client library?

I can't seem to find any information on the Application Name used by various Google API services. The best I can figure is that it might simply be a name that will display on the consent screen? Below is an example of the application name I'm talking about.

calendarService = new Calendar.Builder( HTTP_TRANSPORT , JSON_FACTORY , credential )
        .setApplicationName( applicationName )
        .build();

Also, if I create multiple calendarServices, would/should I give each a unique application name?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
setApplicationName( applicationName )

I beleave that the name displayed to the user on the consent screen is configured in Google developer console when you set up the Client screen.

As far as I know the Application name is sent as part of the user agent Header on all HTTP requests to google but you will need to check the Google api java client.

Update:

Its definatly used for the UserAgent header : AbstractGoogleClient.java


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...