-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support Google Play Achievement #18456
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
dumganhar
merged 7 commits into
cocos:v3.8.6
from
qiuguohua:v3.8.6_fix_gp_achievements_load
Mar 13, 2025
Merged
Support Google Play Achievement #18456
dumganhar
merged 7 commits into
cocos:v3.8.6
from
qiuguohua:v3.8.6_fix_gp_achievements_load
Mar 13, 2025
Conversation
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
Code Size Check Report
Interface Check Report! WARNING this pull request has changed these public interfaces:
@@ -59082,8 +59082,14 @@
export const RecallAccess: typeof __private.__types_jsb__jsb.RecallAccess;
export type RecallAccess = __private.__types_jsb__jsb.RecallAccess;
export const PlayException: typeof __private.__types_jsb__jsb.PlayException;
export type PlayException = __private.__types_jsb__jsb.PlayException;
+ export const AnnotatedData: typeof __private.__types_jsb__jsb.AnnotatedData;
+ export type AnnotatedData = __private.__types_jsb__jsb.AnnotatedData;
+ export const AchievementBuffer: typeof __private.__types_jsb__jsb.AchievementBuffer;
+ export type AchievementBuffer = __private.__types_jsb__jsb.AchievementBuffer;
+ export const Achievement: typeof __private.__types_jsb__jsb.Achievement;
+ export type Achievement = __private.__types_jsb__jsb.Achievement;
export type Continuation<T, K = void> = __private._vendor_google_play_task__ContinuationHelper<T, K>;
export type Task<T, K = void> = __private._vendor_google_play_task__TaskHelper<T, K>;
}
}
@@ -73666,8 +73672,35 @@
public hashCode(): number;
public getSessionId(): string;
public equals(other: __types_jsb_jsb__RecallAccess): boolean;
}
+ export class __types_jsb_jsb__Achievement {
+ public static STATE_UNLOCKED: number;
+ public static STATE_REVEALED: number;
+ public static STATE_HIDDEN: number;
+ public static TYPE_STANDARD: number;
+ public static TYPE_INCREMENTAL: number;
+ public getCurrentSteps(): number;
+ public getState(): number;
+ public getTotalSteps(): number;
+ public getType(): number;
+ public getLastUpdatedTimestamp(): number;
+ public getXpValue(): number;
+ public getAchievementId(): string;
+ public getDescription(): string;
+ public getFormattedCurrentSteps(): string;
+ public getFormattedTotalSteps(): string;
+ public getName(): string;
+ public getRevealedImageUrl(): string;
+ public getUnlockedImageUrl(): string;
+ }
+ export class __types_jsb_jsb__AchievementBuffer {
+ public getCount(): number;
+ public get(i: number): __types_jsb_jsb__Achievement;
+ public close(): void;
+ public release(): void;
+ public isClosed(): boolean;
+ }
export class __types_jsb_jsb__AchievementsClient {
public showAchievements(): void;
public incrementImmediate(id: string, numSteps: number): __types_jsb_jsb__PlayTask;
public load(forceReload: boolean): __types_jsb_jsb__PlayTask;
@@ -74961,8 +74994,39 @@
public isAuthenticated(): __types_jsb_jsb__PlayTask;
public requestServerSideAccess(serverClientId: string, forceRefreshToken: boolean): __types_jsb_jsb__PlayTask;
public signIn(): __types_jsb_jsb__PlayTask;
}
+ export class Achievement {
+ public static STATE_UNLOCKED: number;
+ public static STATE_REVEALED: number;
+ public static STATE_HIDDEN: number;
+ public static TYPE_STANDARD: number;
+ public static TYPE_INCREMENTAL: number;
+ public getCurrentSteps(): number;
+ public getState(): number;
+ public getTotalSteps(): number;
+ public getType(): number;
+ public getLastUpdatedTimestamp(): number;
+ public getXpValue(): number;
+ public getAchievementId(): string;
+ public getDescription(): string;
+ public getFormattedCurrentSteps(): string;
+ public getFormattedTotalSteps(): string;
+ public getName(): string;
+ public getRevealedImageUrl(): string;
+ public getUnlockedImageUrl(): string;
+ }
+ export class AchievementBuffer {
+ public getCount(): number;
+ public get(i: number): __types_jsb_jsb__Achievement;
+ public close(): void;
+ public release(): void;
+ public isClosed(): boolean;
+ }
+ export class AnnotatedData {
+ public isStale(): boolean;
+ public get(): __types_jsb_jsb__AchievementBuffer;
+ }
export class AchievementsClient {
public showAchievements(): void;
public incrementImmediate(id: string, numSteps: number): __types_jsb_jsb__PlayTask;
public load(forceReload: boolean): __types_jsb_jsb__PlayTask;
@@ -75138,9 +75202,9 @@
}
export class _vendor_google_play_games__AchievementsClient {
showAchievements(): void;
incrementImmediate(id: string, numSteps: number): _vendor_google_play_task__TaskHelper<boolean>;
- load(id: boolean): _vendor_google_play_task__TaskHelper<boolean>;
+ load(forceReload: boolean): _vendor_google_play_task__TaskHelper<__types_jsb__jsb.AnnotatedData>;
revealImmediate(id: string): _vendor_google_play_task__TaskHelper<void>;
setStepsImmediate(id: string, numSteps: number): _vendor_google_play_task__TaskHelper<boolean>;
unlockImmediate(id: string): _vendor_google_play_task__TaskHelper<void>;
increment(id: string, numSteps: number): void;
@@ -75163,8 +75227,12 @@
}
export class __types_jsb_jsb__AuthenticationResult {
public isAuthenticated(): boolean;
}
+ export class __types_jsb_jsb__AnnotatedData {
+ public isStale(): boolean;
+ public get(): __types_jsb_jsb__AchievementBuffer;
+ }
export enum _cocos_video_video_player_enums__VideoPlayerEventType {
/**
* @en None.
* @zh 无。
|
dumganhar
reviewed
Mar 13, 2025
bofeng-song
reviewed
Mar 13, 2025
dumganhar
reviewed
Mar 13, 2025
dumganhar
reviewed
Mar 13, 2025
dumganhar
reviewed
Mar 13, 2025
dumganhar
reviewed
Mar 13, 2025
dumganhar
reviewed
Mar 13, 2025
dumganhar
reviewed
Mar 13, 2025
bofeng-song
approved these changes
Mar 13, 2025
dumganhar
reviewed
Mar 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Re: #
Description
https://developers.google.com/android/reference/com/google/android/gms/games/AnnotatedData
https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement
https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementBuffer
This version of the implementation is different from google play, in google play the type of AnnotatedData is a template, but currently only supports AchievementBuffer, so the current implementation is not implemented as a template.
Some methods are not realized:
AchievementBuffer :
close()
release()
Iterator iterator()
isCloseed()
Bundle getMetadata()
Iterator singleRefIterator()
Achievement:
getDescription(@nonnull CharArrayBuffer var1);
getFormattedCurrentSteps(@nonnull CharArrayBuffer var1);
getFormattedTotalSteps(@nonnull CharArrayBuffer var1);
getName(@nonnull CharArrayBuffer var1);
Uri getRevealedImageUri();
Uri getUnlockedImageUri();
But there are deprecated interfaces for this interface, and the already implemented
String getRevealedImageUrl();
String getUnlockedImageUrl();
Continuous Integration
This pull request:
Compatibility Check
This pull request: