برای نصب نسخه قبلی، از نام بسته قدیمی (نسخه نشده) با یک واجد شرایط نسخه صریح استفاده کنید.
# Notice the @v3 suffix.# This instructs Go tools to fetch the latest v3.x release of the SDK.gogetfirebase.google.com/go@v3
توسعه دهندگانی که در حال حاضر از ماژول ها استفاده نمی کنند
توسعهدهندگانی که هنوز ماژولها را انتخاب نکردهاند، میتوانند به نصب SDK با استفاده از نام بسته بدون نسخه ادامه دهند.
gogetfirebase.google.com/go
با این حال، توجه داشته باشید که این آخرین نسخه SDK (نسخه 4 یا جدیدتر) را دریافت می کند که شامل سایر تغییرات API شکسته است.
تغییرات رسیدگی به خطاهای عمومی
v4 SDK یک بسته errorutils جدید را معرفی می کند که عملکردهایی را برای مدیریت شرایط خطا در سطح پلت فرم ارائه می دهد. در صورتی که خطای خطای سرویس پشتیبان ایجاد شده باشد، می توانید با فراخوانی تابع جدید errorutils.HTTPResponse() به پاسخ خطای اصلی دسترسی پیدا کنید. می توانید از توابع موجود در این بسته با خطاهایی که توسط هر API در SDK برگردانده شده است استفاده کنید.
Authentication API تغییر می کند
توابع مدیریت خطای جدید اضافه شده است تا در ارتباط با VerifyIDToken() و VerifySessionCookie() API استفاده شود:
IsIDTokenInvalid()
IsIDTokenExpired()
IsSessionCookieInvalid()
IsSessionCookieExpired()
IsCertificateFetchFailed()
منسوخ شده:
IsProjectNotFound()
IsUnknown()
IsInsufficientPermission()
IsInvalidEmail()
تغییرات API FCM
نام نوع messaging.WebpushFCMOptions را به messaging.WebpushFcmOptions تغییر داد.
اضافه شد:
IsThirdPartyAuthError()
IsQuotaExceeded()
IsSenderIDMismatch()
IsUnregistered()
IsUnavailable()
منسوخ شده:
IsInvalidAPNSCredentials()
IsMessageRateExceeded()
IsMismatchedCredential()
IsRegistrationTokenNotRegistered()
IsServerUnavailable()
IsTooManyTopics()
IsUnknown()
IID API تغییر می کند
همه توابع رسیدگی به خطا که در حال حاضر در بسته iid موجود است، اکنون منسوخ شده اند. به جای آن از توابع مربوط به رسیدگی به خطای ارائه شده در بسته errorutils استفاده کنید.
تاریخ آخرین بهروزرسانی 2025-08-01 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-08-01 بهوقت ساعت هماهنگ جهانی."],[],[],null,["\u003cbr /\u003e\n\nStarting from version 4.0.0, the Firebase Admin SDK for Go has opted into\n[Go modules](https://github.com/golang/go/wiki/Modules). Also, there are breaking\nchanges in [error handling](/docs/reference/admin/error-handling) and semantics.\n\nInstallation changes\n\nConforming to [modules best practices](https://github.com/golang/go/wiki/Modules#semantic-import-versioning),\nthe SDK's major version has been appended to the package name. This\nchange results in the following package name updates:\n\n- firebase.google.com/go → firebase.google.com/go/v4\n- firebase.google.com/go/auth → firebase.google.com/go/v4/auth\n- firebase.google.com/go/db → firebase.google.com/go/v4/db\n- firebase.google.com/go/iid → firebase.google.com/go/v4/iid\n- firebase.google.com/go/messaging → firebase.google.com/go/v4/messaging\n\n| **Note:** Developers who are already using Go modules **must** use the new versioned package name when installing and importing the SDK.\n\nDevelopers already using modules\n\nUse the versioned package name to install the latest version of the SDK. \n\n # Install the latest version:\n go install firebase.google.com/go/v4@latest\n\n # Or install a specific version:\n go install firebase.google.com/go/v4@4.18.0\n\nThe same versioned package name must be used in the source code when importing\nthe SDK. \n\n package helloworld\n\n import (\n \"firebase.google.com/go/v4\"\n \"firebase.google.com/go/v4/auth\"\n \"firebase.google.com/go/v4/messaging\"\n )\n\nTo install an earlier version, use the old (unversioned) package name with an\nexplicit version qualifier. \n\n # Notice the @v3 suffix.\n # This instructs Go tools to fetch the latest v3.x release of the SDK.\n go get firebase.google.com/go@v3\n\nDevelopers not currently using modules\n\nDevelopers who haven't opted into modules yet can continue to install the SDK\nusing the unversioned package name. \n\n go get firebase.google.com/go\n\nNote, however, that this fetches the latest version of the SDK (v4 or later)\nwhich contains other breaking API changes.\n\nGeneral error handling changes\n\nThe v4 SDK introduces a new `errorutils` package that provides functions for\nhandling platform-level error conditions. In the event an error was caused by a\nbackend service error, you can access the original error response by calling\nthe new function `errorutils.HTTPResponse()`. You can use the functions in\nthis package with errors returned by any API in the SDK.\n\nAuthentication API changes\n\n- Added new error handling functions to be used in conjunction with `VerifyIDToken()` and `VerifySessionCookie()` APIs:\n - `IsIDTokenInvalid()`\n - `IsIDTokenExpired()`\n - `IsSessionCookieInvalid()`\n - `IsSessionCookieExpired()`\n - `IsCertificateFetchFailed()`\n- Deprecated:\n - `IsProjectNotFound()`\n - `IsUnknown()`\n - `IsInsufficientPermission()`\n - `IsInvalidEmail()`\n\nFCM API changes\n\n- Renamed the type `messaging.WebpushFCMOptions` to `messaging.WebpushFcmOptions`.\n- Added:\n - `IsThirdPartyAuthError()`\n - `IsQuotaExceeded()`\n - `IsSenderIDMismatch()`\n - `IsUnregistered()`\n - `IsUnavailable()`\n- Deprecated:\n - `IsInvalidAPNSCredentials()`\n - `IsMessageRateExceeded()`\n - `IsMismatchedCredential()`\n - `IsRegistrationTokenNotRegistered()`\n - `IsServerUnavailable()`\n - `IsTooManyTopics()`\n - `IsUnknown()`\n\nIID API changes\n\nAll error handling functions currently available in the `iid` package are now\ndeprecated. Use the corresponding error handling functions provided in the\n`errorutils` package instead."]]