Site: https://developers.google.com
    API: https://developers.google.com/cloud-messaging/
    Desc: Android notifications
549785
def send(user, message, **kwargs):
    

    headers = {
        "Content-type": "application/json",
        "Authorization": "key=" + kwargs.pop("gcm_key", settings.GCM_KEY)
    }

    hook_url = 'https://android.googleapis.com/gcm/send'

    data = {
        "registration_ids": [user],
        "data": {
            "title": kwargs.pop("event"),
            'message': message,
        }
    }
    data['data'].update(kwargs)

    up = urlparse(hook_url)
    http = HTTPSConnection(up.netloc)
    http.request(
        "POST", up.path,
        headers=headers,
        body=dumps(data))
    response = http.getresponse()

    if response.status != 200:
        raise GCMError(response.reason)

    body = response.read()
    if loads(body).get("failure") > 0:
        raise GCMError(repr(body))
    return True
858661
public String notifyResponsibles() throws CmsException {

        Iterator<CmsContentNotification> notifications = filterConfirmedResources(getContentNotifications()).iterator();
        if (notifications.hasNext()) {
            StringBuffer result = new StringBuffer(
                Messages.get().getBundle().key(Messages.LOG_NOTIFICATIONS_SENT_TO_0));
            result.append(' ');
            while (notifications.hasNext()) {
                CmsContentNotification contentNotification = notifications.next();
                result.append(contentNotification.getResponsible().getName());
                if (notifications.hasNext()) {
                    result.append(", ");
                }
                try {
                    contentNotification.send();
                } catch (EmailException e) {
                    LOG.error(e.getLocalizedMessage(), e);
                }
            }
            return result.toString();
        } else {
            return Messages.get().getBundle().key(Messages.LOG_NO_NOTIFICATIONS_SENT_0);
        }
    }
485193
def get_notifications(self, **params):
        """"""
        response = self._get('v2', 'notifications', params=params)
        return self._make_api_object(response, Notification)
1152171
def notify(title,
           message,
           auth_token,
           source=None,
           url=None,
           url_title=None,
           image=None,
           ttl=None,
           important=False,
           silent=False,
           retcode=None):
    

    data = {
        'Title': title,
        'Body': message,
        'AuthorizationToken': auth_token,
    }

    if source:
        data['Source'] = source
    if url:
        data['Link'] = url
    if url and url_title:
        data['LinkTitle'] = url_title
    if image:
        data['Image'] = image
    if ttl:
        data['TimeToLive'] = int(ttl)
    if important:
        data['IsImportant'] = 'True'
    if silent:
        data['IsSilent'] = 'True'

    headers = {'User-Agent': USER_AGENT}
    response = requests.post(PUSHALOT_API_URL, data=data, headers=headers)
    response.raise_for_status()
1352617
private Notification buildNotification() {
        Notification notification = mNotificationBuilder.build();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            notification.bigContentView = mNotificationExpandedView;
        }
        return notification;
    }
996203
def process_notification(notification)
      Flapjack.logger.debug { "Processing notification: #{notification.inspect}" }

      check       = notification.check
      check_name  = check.name

      # TODO check whether time should come from something stored in the notification
      alerts = alerts_for(notification, check, :time => Time.now)

      if alerts.nil? || alerts.empty?
        Flapjack.logger.info { "No alerts" }
      else
        Flapjack.logger.info { "Alerts: #{alerts.size}" }

        alerts.each do |alert|
          medium = alert.medium

          Flapjack.logger.info {
            "#{check_name} | #{medium.contact.id} | " \
            "#{medium.transport} | #{medium.address}\n" \
            "Enqueueing #{medium.transport} alert for " \
            "#{check_name} to #{medium.address} " \
            " rollup: #{alert.rollup || '-'}"
          }

          @queues[medium.transport].push(alert)
        end
      end

      notification.destroy
    end
106430
function NotificationCenterDev({ iconName, onSingleClick, store, panelFooter, panelHeader }) {
    return (
        <Provider store={store}>
            <div>
                <NotificationCenter
                    iconName={iconName}
                    hasAddNotif={false}
                    onSingleClick={onSingleClick}
                    panelHeader={panelHeader}
                    panelFooter={panelFooter}
                />
                <DevTools />
            </div>
        </Provider>
    );
}
207764
@Override
    public void onReceive(Context context, Intent notification) {
        GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
        String messageType = gcm.getMessageType(notification);
        Bundle extras = notification.getExtras();

        if (!extras.isEmpty() && GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {
            showNotification(context, extras);
        }
    }
1073223
public PushedNotifications getSuccessfulNotifications() {
		PushedNotifications filteredList = new PushedNotifications(this);
		for (PushedNotification notification : this) {
			if (notification.isSuccessful()) filteredList.add(notification);
		}
		return filteredList;
	}
77546
def get_notifications(self, new=True):
        """"""
        url = (self._imgur._base_url + "/3/account/{0}/"
               "notifications".format(self.name))
        resp = self._imgur._send_request(url, params=locals(), needs_auth=True)
        msgs = [Message(msg_dict, self._imgur, has_fetched=True) for msg_dict
                in resp['messages']]
        replies = [Comment(com_dict, self._imgur, has_fetched=True) for
                   com_dict in resp['replies']]
        return {'messages': msgs, 'replies': replies}
1161031
def notifications_view(request):
    
    page_name = "Your Notifications"
    # Copy the notifications so that they are still unread when we render the page
    notifications = list(request.user.notifications.all())
    request.user.notifications.mark_all_as_read()
    return render_to_response("list_notifications.html", {
        "page_name": page_name,
        "notifications": notifications,
        }, context_instance=RequestContext(request))
855566
private void notifyStatus(SmsMessage message) {
        URI callback = message.getStatusCallback();
        if (callback != null) {
            String method = message.getStatusCallbackMethod();
            if (method != null && !method.isEmpty()) {

                if (!org.apache.http.client.methods.HttpGet.METHOD_NAME.equalsIgnoreCase(method)
                        && !org.apache.http.client.methods.HttpPost.METHOD_NAME.equalsIgnoreCase(method)) {
                    final Notification notification = notification(WARNING_NOTIFICATION, 14104, method
                            + " is not a valid HTTP method for <Sms>");
                    storage.getNotificationsDao().addNotification(notification);
                    method = org.apache.http.client.methods.HttpPost.METHOD_NAME;
                }
            } else {
                method = org.apache.http.client.methods.HttpPost.METHOD_NAME;
            }


            List<NameValuePair> parameters = populateReqParams(message);
            HttpRequestDescriptor request = new HttpRequestDescriptor(callback, method, parameters);
            downloader().tell(request, self());

        }
    }
513513
def get_notifications(user):
    ''''''
    notifications = []

    for name, func in _providers.items():
        notifications.extend([{
            'type': name,
            'created_on': dt,
            'details': details
        } for dt, details in func(user)])

    return notifications
308219
public java.util.List<String> getNotificationARNs() {
        if (notificationARNs == null) {
            notificationARNs = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return notificationARNs;
    }
865137
public List<String> getScheduledNotificationMessage(ScheduledNotification notification) {
        return broker.callRPCList("RGCWXQ SCHMSG", null, notification.getIen());
    }
259526
public function getNotifications()
    {
        $repository = $this->getService('repos:notifications.notification');

        return $repository->getQuery()
                ->status(ComNotificationsDomainEntityNotification::STATUS_SENT)
                ->id($this->notificationIds->toArray())
                ->toEntityset();
    }
733522
@Override
    public void notificationCreated(RuntimeUpdateManager updateManager, RuntimeUpdateNotification notification) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(this, tc, "GPCL: RuntimeUpdate notification " + notification.getName() + ", apps in service = " + appsInService);

        if (this.appsInService > 0 && notification.getName().equals(RuntimeUpdateNotification.CONFIG_UPDATES_DELIVERED)) {
            setFutureGeneratePluginTask();
            notification.onCompletion(new ConfigUpdateListener());
        }
    }