-
Notifications
You must be signed in to change notification settings - Fork 435
Developer guide: four more sentences that promise code and do not deliver #5813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
882ce45
Developer guide: four more sentences that promise code and do not del…
shai-almog e94b0df
Developer guide: show the Android App Link filter, not just name it
shai-almog 56a8181
Developer guide: a failed ad initialize has to stop the flow
shai-almog 1152482
Developer guide: say what the two ad callbacks actually promise
shai-almog 2768f5f
Developer guide: two more claims the implementations do not support
shai-almog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
107 changes: 107 additions & 0 deletions
107
...ain/java/com/codenameone/developerguide/snippets/generated/AdvertisingJava009Snippet.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| /* | ||
| * Copyright (c) 2012, Codename One and/or its affiliates. All rights reserved. | ||
| * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| * This code is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU General Public License version 2 only, as | ||
| * published by the Free Software Foundation. Codename One designates this | ||
| * particular file as subject to the "Classpath" exception as provided | ||
| * by Oracle in the LICENSE file that accompanied this code. | ||
| * | ||
| * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| * version 2 for more details (a copy is included in the LICENSE file that | ||
| * accompanied this code). | ||
| * | ||
| * You should have received a copy of the GNU General Public License version | ||
| * 2 along with this work; if not, write to the Free Software Foundation, | ||
| * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| * | ||
| * Please contact Codename One through http://www.codenameone.com/ if you | ||
| * need additional information or have any questions. | ||
| */ | ||
| package com.codenameone.developerguide.snippets.generated; | ||
|
|
||
| import com.codename1.gpu.*; | ||
| import com.codename1.ui.*; | ||
| import com.codename1.ui.animations.*; | ||
| import com.codename1.ui.events.*; | ||
| import com.codename1.ui.geom.*; | ||
| import com.codename1.ui.layouts.*; | ||
| import com.codename1.ui.list.*; | ||
| import com.codename1.ui.plaf.*; | ||
| import com.codename1.ui.util.*; | ||
| import com.codename1.components.*; | ||
| import com.codename1.charts.models.*; | ||
| import com.codename1.charts.renderers.*; | ||
| import com.codename1.charts.views.*; | ||
| import com.codename1.capture.*; | ||
| import com.codename1.io.*; | ||
| import com.codename1.l10n.*; | ||
| import com.codename1.location.*; | ||
| import com.codename1.maps.*; | ||
| import com.codename1.media.*; | ||
| import com.codename1.messaging.*; | ||
| import com.codename1.payment.*; | ||
| import com.codename1.processing.*; | ||
| import com.codename1.properties.*; | ||
| import com.codename1.push.*; | ||
| import com.codename1.security.*; | ||
| import com.codename1.social.*; | ||
| import com.codename1.ui.spinner.*; | ||
| import java.io.*; | ||
| import com.codename1.analytics.*; | ||
| import com.codename1.appreview.*; | ||
| import com.codename1.ads.*; | ||
| import com.codename1.util.*; | ||
| import java.util.*; | ||
|
|
||
|
|
||
| class AdvertisingJava009Snippet { | ||
|
|
||
| Form form; | ||
|
|
||
| // tag::advertising-java-009[] | ||
| void startAds() { | ||
| AdConfig cfg = new AdConfig() | ||
| .testMode(true) | ||
| .addTestDevice("YOUR_TEST_DEVICE_ID") | ||
| .tagForChildDirectedTreatment(AdConfig.TAG_FALSE) | ||
| .maxAdContentRating(AdConfig.RATING_G); | ||
|
|
||
| AdManager.initialize(cfg, ready -> { | ||
| // false when no provider was installed. It is not a report that | ||
| // the network is up: every provider hands its config to the native | ||
| // bridge and answers true straight away, while the SDK behind it | ||
| // initializes asynchronously. Worth checking anyway, because with | ||
| // no provider at all AdConsent reports consent as not required and | ||
| // canRequestAds() answers true, so carrying on would walk into | ||
| // loadAds() with nothing behind it. | ||
| if (!ready) { | ||
| showAdFreeUi(); | ||
| return; | ||
| } | ||
|
|
||
| // Consent has to be settled before the first load, not before | ||
| // initialize: requestConsent presents the GDPR form and, on iOS, | ||
| // the App Tracking Transparency prompt, and both need the SDK up. | ||
| AdConsent.requestConsent(status -> { | ||
| if (AdConsent.canRequestAds()) { | ||
| loadAds(); | ||
|
shai-almog marked this conversation as resolved.
|
||
| } else { | ||
| // STATUS_REQUIRED with consent withheld. Personalized ads | ||
| // are off the table; show the app without them rather | ||
| // than blocking on a prompt the user already declined. | ||
| showAdFreeUi(); | ||
| } | ||
| }); | ||
| }); | ||
| } | ||
|
|
||
| void loadAds() { | ||
| } | ||
|
|
||
| void showAdFreeUi() { | ||
| } | ||
| // end::advertising-java-009[] | ||
| } | ||
30 changes: 30 additions & 0 deletions
30
docs/demos/common/src/main/snippets/developer-guide/deep-links-routing.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // Generated from docs/developer-guide source blocks. Edit the guide snippets here, not inline. | ||
|
|
||
| // tag::deep-links-routing-json-001[] | ||
| { | ||
| "applinks": { | ||
| "details": [ | ||
| { | ||
| "appIDs": ["ABCDE12345.com.example.app"], | ||
| "components": [ | ||
| { "/": "/users/*" }, | ||
| { "/": "/promo/*" } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| // end::deep-links-routing-json-001[] | ||
|
|
||
| // tag::deep-links-routing-json-002[] | ||
| [ | ||
| { | ||
| "relation": ["delegate_permission/common.handle_all_urls"], | ||
| "target": { | ||
| "namespace": "android_app", | ||
| "package_name": "com.example.app", | ||
| "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5", "7B:5A:1F:C9:0E:52:44:7C:82:19:6E:38:0A:B7:D4:11:5C:63:9F:28:E1:47:8B:30:A6:C2:5D:94:F0:6B:38:19"] | ||
| } | ||
| } | ||
| ] | ||
| // end::deep-links-routing-json-002[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.