@maccesar/titools 5.1.1 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +69 -0
- package/README.md +112 -72
- package/agents/ti-pro.md +5 -1
- package/commands/ti-audit.md +5 -1
- package/docs/examples.md +91 -0
- package/docs/knowledge-index.md +57 -0
- package/lib/config.js +2 -0
- package/lib/downloader.js +1 -1
- package/package.json +4 -2
- package/skills/purgetss/references/multi-density-images.md +1 -1
- package/skills/ti-admob-unified/SKILL.md +58 -0
- package/skills/ti-admob-unified/agents/openai.yaml +4 -0
- package/skills/ti-admob-unified/assets/example/app.js +1207 -0
- package/skills/ti-admob-unified/assets/example/lib/ads.js +646 -0
- package/skills/ti-admob-unified/assets/example/library-usage.js +136 -0
- package/skills/ti-admob-unified/references/api-reference.md +615 -0
- package/skills/ti-admob-unified/references/banners.md +435 -0
- package/skills/ti-admob-unified/references/contributing.md +233 -0
- package/skills/ti-admob-unified/references/dependencies.md +91 -0
- package/skills/ti-admob-unified/references/fullscreen.md +238 -0
- package/skills/ti-admob-unified/references/game-monetization.md +148 -0
- package/skills/ti-admob-unified/references/getting-started.md +319 -0
- package/skills/ti-admob-unified/references/index.md +33 -0
- package/skills/ti-admob-unified/references/integration.md +87 -0
- package/skills/ti-admob-unified/references/library.md +220 -0
- package/skills/ti-admob-unified/references/mediation-parity.md +17 -0
- package/skills/ti-admob-unified/references/mediation.md +145 -0
- package/skills/ti-admob-unified/references/migration.md +259 -0
- package/skills/ti-admob-unified/references/module-changelog.md +84 -0
- package/skills/ti-admob-unified/references/module-license.txt +21 -0
- package/skills/ti-admob-unified/references/privacy.md +281 -0
- package/skills/ti-admob-unified/references/production.md +67 -0
- package/skills/ti-admob-unified/references/rewarded-interstitial.md +101 -0
- package/skills/ti-admob-unified/references/roadmap.md +143 -0
- package/skills/ti-admob-unified/references/source-notes.md +80 -0
- package/skills/ti-admob-unified/references/source-snapshot.json +644 -0
- package/skills/ti-admob-unified/references/third-party-notices.md +22 -0
- package/skills/ti-game/SKILL.md +31 -5
- package/skills/ti-game/references/api.md +36 -24
- package/skills/ti-game/references/debugging-performance.md +22 -7
- package/skills/ti-game/references/examples.md +113 -20
- package/skills/ti-game/references/input.md +101 -0
- package/skills/ti-game/references/patterns.md +56 -10
- package/skills/ti-game/references/physics.md +530 -0
- package/skills/ti-game/references/project-setup.md +131 -47
- package/skills/ti-game/references/recipes-action.md +149 -18
- package/skills/ti-game/references/recipes-adventure-effects.md +47 -4
- package/skills/ti-game/references/roadmap.md +11 -4
- package/skills/ti-game/references/source-notes.md +81 -0
- package/skills/ti-game/references/tilemaps.md +13 -4
- package/skills/ti-game-assets/SKILL.md +53 -0
- package/skills/ti-game-assets/agents/openai.yaml +4 -0
- package/skills/ti-game-assets/references/alpha.md +26 -0
- package/skills/ti-game-assets/references/art-direction.md +37 -0
- package/skills/ti-game-assets/references/integration.md +49 -0
- package/skills/ti-game-assets/references/manifest.example.json +429 -0
- package/skills/ti-game-assets/references/manifest.md +39 -0
- package/skills/ti-game-assets/references/offline-audio.md +33 -0
- package/skills/ti-game-assets/references/prompts.md +33 -0
- package/skills/ti-game-assets/references/repeating-textures.md +17 -0
- package/skills/ti-game-assets/references/responsible-ads.md +31 -0
- package/skills/ti-game-assets/references/sound-assets.md +42 -0
- package/skills/ti-game-assets/references/vector-sources.md +21 -0
- package/skills/ti-game-assets/scripts/alpha_tools.py +160 -0
- package/skills/ti-game-assets/scripts/requirements.txt +1 -0
- package/skills/ti-game-assets/scripts/validate_manifest.py +267 -0
- package/skills/ti-synthengine/SKILL.md +77 -67
- package/skills/ti-synthengine/assets/example/README.md +84 -0
- package/skills/ti-synthengine/assets/example/app.js +1178 -0
- package/skills/ti-synthengine/assets/example/lib/sequenceOwner.js +83 -0
- package/skills/ti-synthengine/assets/example/lib/sequenceScore.js +25 -0
- package/skills/ti-synthengine/references/advanced-examples.md +174 -0
- package/skills/ti-synthengine/references/android-sim80-correction-evidence.zip +0 -0
- package/skills/ti-synthengine/references/android-sim80-correction.json +162 -0
- package/skills/ti-synthengine/references/api.md +573 -153
- package/skills/ti-synthengine/references/audio-engine.md +272 -124
- package/skills/ti-synthengine/references/bypass-physical-recheck-evidence.zip +0 -0
- package/skills/ti-synthengine/references/examples.md +355 -106
- package/skills/ti-synthengine/references/frontier-android-evidence.zip +0 -0
- package/skills/ti-synthengine/references/frontier-ipad-evidence.zip +0 -0
- package/skills/ti-synthengine/references/frontier-physical-validation.json +1918 -0
- package/skills/ti-synthengine/references/guide.md +426 -75
- package/skills/ti-synthengine/references/performance-review-evidence.zip +0 -0
- package/skills/ti-synthengine/references/performance-review.json +1146 -0
- package/skills/ti-synthengine/references/physical-validation.json +1457 -0
- package/skills/ti-synthengine/references/recipes-interaction.md +549 -0
- package/skills/ti-synthengine/references/recipes.md +434 -420
- package/skills/ti-synthengine/references/recommendations.md +72 -85
- package/skills/ti-synthengine/references/sound-design.md +375 -155
- package/skills/ti-synthengine/references/source-notes.md +109 -0
- package/skills/ti-synthengine/references/source-snapshot.json +452 -0
- package/skills/ti-synthengine/references/stats-performance.json +2992 -0
- package/skills/ti-synthengine/references/stats-performance.md +82 -0
- package/skills/ti-synthengine/references/studio-validation.json +6202 -0
- package/skills/ti-synthengine/references/troubleshooting.md +123 -78
- package/skills/ti-synthengine/references/unified-bypass-performance.json +22425 -0
- package/skills/ti-synthengine/references/unified-validation.json +314 -0
- package/AGENTS-VERCEL-RESEARCH.md +0 -175
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Usage of example/lib/ads.js after copying it to the consuming app's lib/.
|
|
5
|
+
* This file is intentionally separate from app.js, which demonstrates the raw
|
|
6
|
+
* module API. Pick one integration style; do not initialize both.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const Admob = require('ti.admob.unified')
|
|
10
|
+
const ads = require('lib/ads') // Classic; Alloy app/lib/ads.js: require('ads')
|
|
11
|
+
|
|
12
|
+
const win = Ti.UI.createWindow({ layout: 'composite', backgroundColor: '#ffffff' })
|
|
13
|
+
const content = Ti.UI.createScrollView({ top: 0, left: 0, right: 0, bottom: 0 })
|
|
14
|
+
const bannerHost = Ti.UI.createView({ left: 0, right: 0, bottom: 0, height: 50 })
|
|
15
|
+
|
|
16
|
+
win.add(content)
|
|
17
|
+
win.add(bannerHost)
|
|
18
|
+
|
|
19
|
+
const banner = ads.createBanner({
|
|
20
|
+
host: bannerHost,
|
|
21
|
+
content,
|
|
22
|
+
reservedHeight: 50,
|
|
23
|
+
adUnitId: Admob.TEST_BANNER,
|
|
24
|
+
adSize: Admob.BANNER
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
// Use this instead of createBanner() when the placement should adapt to width.
|
|
28
|
+
function createAdaptiveBanner() {
|
|
29
|
+
banner.destroy()
|
|
30
|
+
return ads.createAdaptiveBanner({
|
|
31
|
+
host: bannerHost,
|
|
32
|
+
content,
|
|
33
|
+
reservedHeight: 50,
|
|
34
|
+
adUnitId: Admob.TEST_ADAPTIVE_BANNER,
|
|
35
|
+
adaptiveType: Admob.ADAPTIVE_ANCHORED
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const interstitial = ads.createInterstitial({
|
|
40
|
+
window: win,
|
|
41
|
+
adUnitId: Admob.TEST_INTERSTITIAL,
|
|
42
|
+
onLoaded: () => Ti.API.info('[ads] Interstitial ready')
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const rewarded = ads.createRewarded({
|
|
46
|
+
window: win,
|
|
47
|
+
adUnitId: Admob.TEST_REWARDED,
|
|
48
|
+
onRewarded: event => grantReward(event.rewardAmount, event.rewardType)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const rewardedInterstitial = ads.createRewardedInterstitial({
|
|
52
|
+
window: win,
|
|
53
|
+
adUnitId: Admob.TEST_REWARDED_INTERSTITIAL,
|
|
54
|
+
onRewarded: event => grantReward(event.rewardAmount, event.rewardType)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const appOpen = ads.createAppOpen({
|
|
58
|
+
window: win,
|
|
59
|
+
adUnitId: Admob.TEST_APP_OPEN,
|
|
60
|
+
onLoaded: () => Ti.API.info('[ads] App-open ready for the next foreground')
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
function grantReward(amount, type) {
|
|
64
|
+
Ti.API.info(`[ads] Grant ${amount} ${type}`)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function onNaturalBreak() {
|
|
68
|
+
interstitial.show()
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function onRewardAccepted() {
|
|
72
|
+
rewarded.show()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// In production, rewardDescription must describe the reward configured for
|
|
76
|
+
// this placement. Only onRewarded above credits the actual SDK-earned reward.
|
|
77
|
+
function onRewardedTransition(rewardDescription) {
|
|
78
|
+
if (!rewardedInterstitial.isLoaded()) return
|
|
79
|
+
const intro = Ti.UI.createAlertDialog({
|
|
80
|
+
title: 'Rewarded interstitial',
|
|
81
|
+
message: `Complete the ad to earn ${rewardDescription}. You can skip it.`,
|
|
82
|
+
buttonNames: ['Watch ad', 'Skip'], cancel: 1
|
|
83
|
+
})
|
|
84
|
+
function onChoice(event) {
|
|
85
|
+
intro.removeEventListener('click', onChoice)
|
|
86
|
+
if (event.index === 0) rewardedInterstitial.show()
|
|
87
|
+
}
|
|
88
|
+
intro.addEventListener('click', onChoice)
|
|
89
|
+
intro.show()
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function onApplicationResumed() {
|
|
93
|
+
appOpen.show()
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function openChildWindow() {
|
|
97
|
+
const child = Ti.UI.createWindow({ backgroundColor: '#ffffff' })
|
|
98
|
+
banner.pause()
|
|
99
|
+
child.addEventListener('close', () => banner.resume())
|
|
100
|
+
child.open()
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
win.addEventListener('close', event => {
|
|
104
|
+
if (!event._closeFromActivityForcedToDestroy) ads.destroyAll()
|
|
105
|
+
})
|
|
106
|
+
win.open()
|
|
107
|
+
|
|
108
|
+
// Start in the active foreground. Enable requestTrackingAuthorization only for
|
|
109
|
+
// a real tracking use case with a localized NSUserTrackingUsageDescription.
|
|
110
|
+
// Keep it false when an AdMob UMP IDFA message already handles ATT.
|
|
111
|
+
Ti.API.info('Current ATT state: ' + JSON.stringify(Admob.getTrackingAuthorizationStatus()))
|
|
112
|
+
ads.start({
|
|
113
|
+
consent: { tagForUnderAgeOfConsent: false },
|
|
114
|
+
requestTrackingAuthorization: false,
|
|
115
|
+
initialization: {}
|
|
116
|
+
}).then(result => {
|
|
117
|
+
if (!result.initialized) {
|
|
118
|
+
return
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
interstitial.load()
|
|
122
|
+
rewarded.load()
|
|
123
|
+
rewardedInterstitial.load()
|
|
124
|
+
appOpen.load()
|
|
125
|
+
}).catch(error => {
|
|
126
|
+
Ti.API.warn(`[ads] Startup failed: ${error.message || error}`)
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
// References kept here to make the intended call sites explicit in this
|
|
130
|
+
// compact example. Real apps connect them to their own navigation/lifecycle.
|
|
131
|
+
void createAdaptiveBanner
|
|
132
|
+
void onNaturalBreak
|
|
133
|
+
void onRewardAccepted
|
|
134
|
+
void onRewardedTransition
|
|
135
|
+
void onApplicationResumed
|
|
136
|
+
void openChildWindow
|