ملاحظة مُهمّة: اعتبارًا من
1 أيار (مايو) 2024،
ستطلب شركة Apple بيانات الخصوصية والتوقيعات في تطبيقات iOS التي تستخدم حِزم SDK شائعة الاستخدام، بما في ذلك GoogleSignIn-iOS. يجب الترقية إلى الإصدار 7.1.0 من GoogleSignIn-iOS أو الإصدارات الأحدث قبل 1 أيار (مايو) 2024. اتّبِع
دليل الترقية.
دليل نقل البيانات السريع لتسجيل الدخول بحساب Google
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تعرض هذه الصفحة بالتفصيل التغييرات الأساسية في الإصدارات الرئيسية من حزمة تطوير البرامج (SDK) لتسجيل الدخول بحساب Google.
يُرجى اتّباع التعليمات الواردة في هذا الدليل لنقل تطبيقك إلى أحدث إصدار من حزمة تطوير البرامج (SDK) الخاصة بتسجيل الدخول بحساب Google. لاحظ أن الوثائق تشير دائمًا إلى أحدث إصدار.
يمكنك أيضًا الرجوع إلى ملاحظات الإصدار والمستودع على GitHub للاطّلاع على مزيد من المعلومات.
الإصدار 7.0.0 من حزمة SDK لتسجيل الدخول باستخدام Google أو إصدار أحدث
لنقل تطبيقك من أحد إصدارات حزمة تطوير البرامج (SDK) لتسجيل الدخول بحساب Google الذي يسبق الإصدار 7.0.0،
عليك إجراء التغييرات التالية:
يمكنك ضبط إعدادات عميل OAuth في ملف Info.plist
لتطبيقك.
يمكنك مواصلة ضبط هذه السياسة عند التشغيل (باستخدام عنصر GIDConfiguration
)،
ولكن ننصحك بعدم إجراء ذلك بعد الآن. يمكنك الاطّلاع على دليل البدء للحصول على
أمثلة والمزيد من التفاصيل.
تم نقل الطريقة addScopes:
إلى GIDGoogleUser. بدلاً من
طلب نطاقات تفويض إضافية من GIDSignIn، عليك الآن
طلبها من GIDGoogleUser بعد اكتمال
المصادقة.
في حال ضبط serverClientID
لتفعيل وصول تطبيقك إلى واجهة برمجة التطبيقات من جهة الخادم، سيتم الآن إرجاع serverAuthCode
مع إكمال GIDSignInResult
.
تم نقل المواقع من GIDAuthentication
إلى GIDGoogleUser
.
استدعاء طريقة التحديث:
v6.2.x |
الإصدار 7.0.0 أو أحدث |
GIDSignIn
signInWithConfiguration:presentingViewController:callback:
|
GIDSignIn
signInWithPresentingViewController:completion:
|
GIDSignIn
restorePreviousSignInWithCallback:
|
GIDSignIn
restorePreviousSignInWithCompletion:
|
GIDSignIn
disconnectWithCallback:
|
GIDSignIn
disconnectWithCompletion:
|
GIDAuthentication
doWithFreshTokens:
|
GIDGoogleUser
refreshTokensIfNeededWithCompletion:
|
GIDSignIn
addScopes:presentingViewController:callback:
|
GIDGoogleUser
addScopes:presentingViewController:completion:
|
الإصدار 6.0.0 من حزمة تطوير البرامج (SDK) لتسجيل الدخول بحساب Google
لنقل تطبيقك من أحد إصدارات حزمة تطوير البرامج (SDK) لتسجيل الدخول بحساب Google الذي يسبق الإصدار 6.0.0،
عليك إجراء التغييرات التالية:
عدِّل جميع طلبات [GIDSignIn sharedInstance]
إلى أذونات
موقع GIDSignIn.sharedInstance
.
نقل جميع إعدادات العميل (معرّفات البرامج وغيرها) إلى كائن GIDConfiguration
تعديل عمليات الاستدعاء إلى الطرق التي تمت إزالتها لتصبح مكافئة جديدة لها:
v5.x.x |
v6.0.0 |
signIn |
signInWithConfiguration:presentingViewController:callback: |
restorePreviousSignIn |
restorePreviousSignInWithCallback: |
disconnect |
disconnectWithCallback: |
getTokensWithHandler: |
doWithFreshTokens: |
refreshTokensWithHandler: |
doWithFreshTokens: |
أزِل جميع الإشارات إلى بروتوكول GIDSignInDelegate
وطرقه.
انقل المنطق من signIn:didSignInForUser:withError:
إلى مجموعة معاودة الاتصال في signInWithConfiguration:presentingViewController:callback:
.
انقل المنطق من signIn:didDisconnectWithUser:withError:
إلى مجموعة معاودة الاتصال في disconnectWithCallback:
.
ربط GIDSignInButton
يدويًا بطريقة تستدعي
signInWithConfiguration:presentingViewController:callback:
باستخدام
IBAction
أو ما شابه ذلك.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThis page provides migration guides for updating your app to the latest Google Sign-In SDK versions (v7.0.0+ and v6.0.0).\u003c/p\u003e\n"],["\u003cp\u003eFor v7.0.0+, OAuth client configuration should be set in \u003ccode\u003eInfo.plist\u003c/code\u003e, additional scopes are requested from \u003ccode\u003eGIDGoogleUser\u003c/code\u003e, and various properties and methods have been moved or updated.\u003c/p\u003e\n"],["\u003cp\u003eMigrating to v6.0.0 involves using \u003ccode\u003eGIDConfiguration\u003c/code\u003e for client configuration, updating method calls, and replacing \u003ccode\u003eGIDSignInDelegate\u003c/code\u003e with callback blocks.\u003c/p\u003e\n"],["\u003cp\u003eDetailed information and examples are available in linked resources like release notes, GitHub repository, and the "Get Started" guide.\u003c/p\u003e\n"]]],[],null,["# Google Sign-In quick migration guide\n\nThis page details key changes for major versions of the Google Sign-In SDK.\n\nFollow this guide to migrate your app to the latest version of the Google\nSign-In SDK. Note that the documentation always refers to the most recent\nversion.\n\nAlso refer to the [release notes](/identity/sign-in/ios/release) and the\n[repository on GitHub](https://github.com/google/GoogleSignIn-iOS)\nfor more information.\n\nGoogle Sign-In SDK v7.0.0+\n--------------------------\n\nTo migrate your app from a version of the Google Sign-In SDK prior to v7.0.0,\nmake the following changes:\n\n- Set your OAuth client configuration in your application's `Info.plist` file.\n You can continue to set it at runtime (using a `GIDConfiguration`) object,\n but this is no longer recommended. See the [get\n started](/identity/sign-in/ios/start-integrating#configure_app_project) guide for\n examples and more details.\n\n | `Info.plist` key | Description |\n |---------------------|-------------------------------------------------------------------------------------------------------------------|\n | `GIDClientID` | [OAuth client ID](/identity/sign-in/ios/start-integrating#add_client_id) |\n | `GIDServerClientID` | [Server OAuth client ID for backend authentication](/identity/sign-in/ios/start-integrating#add_server_client_id) |\n | `GIDHostedDomain` | [Google Workspace domain](/identity/sign-in/ios/start-integrating#add_domain_realm) |\n | `GIDOpenIDRealm` | [OpenID realm](/identity/sign-in/ios/start-integrating#add_domain_realm) |\n\n- The `addScopes:` method has been moved to GIDGoogleUser. Instead of\n requesting additional authorization scopes from GIDSignIn, you should now\n [request them from GIDGoogleUser after authentication](/identity/sign-in/ios/api-access#2_request_additional_scopes)\n has completed.\n\n- If you are setting `serverClientID` to [enable server-side API access for\n your app](/identity/sign-in/ios/offline-access), `serverAuthCode` will now be\n returned with `GIDSignInResult` in your completion.\n\n- Properties from `GIDAuthentication` have moved into `GIDGoogleUser`.\n\n- Update method calls:\n\n| v6.2.x | v7.0.0+ |\n|--------------------------------------------------------------------------|------------------------------------------------------------------|\n| `GIDSignIn` `signInWithConfiguration:presentingViewController:callback:` | `GIDSignIn` `signInWithPresentingViewController:completion:` |\n| `GIDSignIn` `restorePreviousSignInWithCallback:` | `GIDSignIn` `restorePreviousSignInWithCompletion:` |\n| `GIDSignIn` `disconnectWithCallback:` | `GIDSignIn` `disconnectWithCompletion:` |\n| `GIDAuthentication` `doWithFreshTokens:` | `GIDGoogleUser` `refreshTokensIfNeededWithCompletion:` |\n| `GIDSignIn` `addScopes:presentingViewController:callback:` | `GIDGoogleUser` `addScopes:presentingViewController:completion:` |\n\nGoogle Sign-In SDK v6.0.0\n-------------------------\n\nTo migrate your app from a version of the Google Sign-In SDK prior to v6.0.0,\nmake the following changes:\n\n- Update all `[GIDSignIn sharedInstance]` calls to `GIDSignIn.sharedInstance`\n property accesses.\n\n- Move all client configuration (client IDs, etc.) to a `GIDConfiguration`\n object.\n\n- Update calls to removed methods to their new equivalents:\n\n | v5.x.x | v6.0.0 |\n |-----------------------------|--------------------------------------------------------------|\n | `signIn` | `signInWithConfiguration:presentingViewController:callback:` |\n | `restorePreviousSignIn` | `restorePreviousSignInWithCallback:` |\n | `disconnect` | `disconnectWithCallback:` |\n | `getTokensWithHandler:` | `doWithFreshTokens:` |\n | `refreshTokensWithHandler:` | `doWithFreshTokens:` |\n\n- Remove all references to the `GIDSignInDelegate` protocol and its methods.\n\n - Move the logic from `signIn:didSignInForUser:withError:` to the callback\n block of `signInWithConfiguration:presentingViewController:callback:`.\n\n - Move the logic from `signIn:didDisconnectWithUser:withError:` to the\n callback block of `disconnectWithCallback:`.\n\n- Manually connect `GIDSignInButton` to a method that calls\n `signInWithConfiguration:presentingViewController:callback:` using an\n `IBAction` or similar."]]