PageRenderTime 38ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/PushSharp.Client/PushSharp.Client.MonoForAndroid.Gcm/GCMConstants.cs

https://github.com/mustafagenc/PushSharp
C# | 136 lines | 37 code | 22 blank | 77 comment | 0 complexity | b1d3f55cdd63238a3571e8ee88ce66a5 MD5 | raw file
Possible License(s): Apache-2.0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Android.App;
  6. using Android.Content;
  7. using Android.OS;
  8. using Android.Runtime;
  9. using Android.Views;
  10. using Android.Widget;
  11. namespace GCMSharp.Client
  12. {
  13. public class GCMConstants
  14. {
  15. public const string INTENT_TO_GCM_REGISTRATION = "com.google.android.c2dm.intent.REGISTER";
  16. /**
  17. * Intent sent to GCM to unregister the application.
  18. */
  19. public const string INTENT_TO_GCM_UNREGISTRATION = "com.google.android.c2dm.intent.UNREGISTER";
  20. /**
  21. * Intent sent by GCM indicating with the result of a registration request.
  22. */
  23. public const string INTENT_FROM_GCM_REGISTRATION_CALLBACK = "com.google.android.c2dm.intent.REGISTRATION";
  24. /**
  25. * Intent used by the GCM library to indicate that the registration call
  26. * should be retried.
  27. */
  28. public const string INTENT_FROM_GCM_LIBRARY_RETRY = "com.google.android.gcm.intent.RETRY";
  29. /**
  30. * Intent sent by GCM containing a message.
  31. */
  32. public const string INTENT_FROM_GCM_MESSAGE = "com.google.android.c2dm.intent.RECEIVE";
  33. /**
  34. * Extra used on {@link #INTENT_TO_GCM_REGISTRATION} to indicate the sender
  35. * account (a Google email) that owns the application.
  36. */
  37. public const string EXTRA_SENDER = "sender";
  38. /**
  39. * Extra used on {@link #INTENT_TO_GCM_REGISTRATION} to get the application
  40. * id.
  41. */
  42. public const string EXTRA_APPLICATION_PENDING_INTENT = "app";
  43. /**
  44. * Extra used on {@link #INTENT_FROM_GCM_REGISTRATION_CALLBACK} to indicate
  45. * that the application has been unregistered.
  46. */
  47. public const string EXTRA_UNREGISTERED = "unregistered";
  48. /**
  49. * Extra used on {@link #INTENT_FROM_GCM_REGISTRATION_CALLBACK} to indicate
  50. * an error when the registration fails. See constants starting with ERROR_
  51. * for possible values.
  52. */
  53. public const string EXTRA_ERROR = "error";
  54. /**
  55. * Extra used on {@link #INTENT_FROM_GCM_REGISTRATION_CALLBACK} to indicate
  56. * the registration id when the registration succeeds.
  57. */
  58. public const string EXTRA_REGISTRATION_ID = "registration_id";
  59. /**
  60. * Type of message present in the {@link #INTENT_FROM_GCM_MESSAGE} intent.
  61. * This extra is only set for special messages sent from GCM, not for
  62. * messages originated from the application.
  63. */
  64. public const string EXTRA_SPECIAL_MESSAGE = "message_type";
  65. /**
  66. * Special message indicating the server deleted the pending messages.
  67. */
  68. public const string VALUE_DELETED_MESSAGES = "deleted_messages";
  69. /**
  70. * Number of messages deleted by the server because the device was idle.
  71. * Present only on messages of special type
  72. * {@link #VALUE_DELETED_MESSAGES}
  73. */
  74. public const string EXTRA_TOTAL_DELETED = "total_deleted";
  75. /**
  76. * Permission necessary to receive GCM intents.
  77. */
  78. public const string PERMISSION_GCM_INTENTS = "com.google.android.c2dm.permission.SEND";
  79. /**
  80. * @see GCMBroadcastReceiver
  81. */
  82. public const string DEFAULT_INTENT_SERVICE_CLASS_NAME = ".GCMIntentService";
  83. /**
  84. * The device can't read the response, or there was a 500/503 from the
  85. * server that can be retried later. The application should use exponential
  86. * back off and retry.
  87. */
  88. public const string ERROR_SERVICE_NOT_AVAILABLE = "SERVICE_NOT_AVAILABLE";
  89. /**
  90. * There is no Google account on the phone. The application should ask the
  91. * user to open the account manager and add a Google account.
  92. */
  93. public const string ERROR_ACCOUNT_MISSING = "ACCOUNT_MISSING";
  94. /**
  95. * Bad password. The application should ask the user to enter his/her
  96. * password, and let user retry manually later. Fix on the device side.
  97. */
  98. public const string ERROR_AUTHENTICATION_FAILED = "AUTHENTICATION_FAILED";
  99. /**
  100. * The request sent by the phone does not contain the expected parameters.
  101. * This phone doesn't currently support GCM.
  102. */
  103. public const string ERROR_INVALID_PARAMETERS = "INVALID_PARAMETERS";
  104. /**
  105. * The sender account is not recognized. Fix on the device side.
  106. */
  107. public const string ERROR_INVALID_SENDER = "INVALID_SENDER";
  108. /**
  109. * Incorrect phone registration with Google. This phone doesn't currently
  110. * support GCM.
  111. */
  112. public const string ERROR_PHONE_REGISTRATION_ERROR = "PHONE_REGISTRATION_ERROR";
  113. }
  114. }