{"record":{"id":"fc4080eee690b6e4","repo":"microg/GmsCore","slug":"no-sender-ids","errorCode":null,"errorMessage":"No sender ids","messagePattern":"No sender ids","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java","lineNumber":196,"sourceCode":"     * <p/>\n     * If you want to modify the list of senders, you must call <code>unregister()</code> first.\n     * <p/>\n     * Most applications use a single sender ID. You may use multiple senders if different\n     * servers may send messages to the app or for testing.</p>\n     *\n     * @param senderIds list of project numbers or Google accounts identifying who is allowed to\n     *                  send messages to this application.\n     * @return registration id\n     * @throws IOException\n     * @deprecated Instead, for GCM registration, use\n     * {@link com.google.android.gms.iid.InstanceID#getToken(java.lang.String, java.lang.String)}.\n     * Set authorizedEntity to a sender ID and scope to {@link com.google.android.gms.gcm.GoogleCloudMessaging#INSTANCE_ID_SCOPE}.\n     */\n    @Deprecated\n    public String register(String... senderIds) throws IOException {\n        if (Looper.getMainLooper() == Looper.myLooper()) throw new IOException(ERROR_MAIN_THREAD);\n\n        if (senderIds == null || senderIds.length == 0) throw new IllegalArgumentException(\"No sender ids\");\n        StringBuilder sb = new StringBuilder(senderIds[0]);\n        for (int i = 1; i < senderIds.length; i++) {\n            sb.append(',').append(senderIds[i]);\n        }\n        String sender = sb.toString();\n\n        if (isLegacyFallback()) {\n            Bundle extras = new Bundle();\n            extras.putString(EXTRA_SENDER_LEGACY, sender);\n            return InstanceID.getInstance(context).getToken(sb.toString(), INSTANCE_ID_SCOPE, extras);\n        } else {\n            Bundle extras = new Bundle();\n            extras.putString(EXTRA_SENDER, sender);\n            return rpc.handleRegisterMessageResult(rpc.sendRegisterMessageBlocking(extras));\n        }\n    }\n\n    /**","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java#L178-L214","documentation":"Thrown by GoogleCloudMessaging.register when the varargs senderIds list is empty. The registration flow requires at least one sender (a project number authorized to send messages to the app); calling register() with zero sender ids leaves no authorization principal to register against, so the method rejects the request with this IllegalArgumentException before contacting the GCM service.","triggerScenarios":"Thrown at play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java:196 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass at least one project number / sender ID to register()","Check the sender list for emptiness before invoking registration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}