urbanairship-core/src/main/java/com/urbanairship/push/PushManager.java
boolean isUniqueCanonicalId(@Nullable String canonicalId) {
        if (UAStringUtil.isEmpty(canonicalId)) {
            return true;
        }

        JsonList jsonList = null;
        try {
            jsonList = JsonValue.parseString(preferenceDataStore.getString(LAST_CANONICAL_IDS_KEY, null)).getList();
        } catch (JsonException e) {
            Logger.debug("PushJobHandler - Unable to parse canonical Ids.", e);
        }

        List<JsonValue> canonicalIds = jsonList == null ? new ArrayList<JsonValue>() : jsonList.getList();

        // Wrap the canonicalId
        JsonValue id = JsonValue.wrap(canonicalId);

        // Check if the list contains the canonicalId
        if (canonicalIds.contains(id)) {
            return false;
        }

        // Add it
        canonicalIds.add(id);
        if (canonicalIds.size() > MAX_CANONICAL_IDS) {
            canonicalIds = canonicalIds.subList(canonicalIds.size() - MAX_CANONICAL_IDS, canonicalIds.size());
        }

        // Store the new list
        preferenceDataStore.put(LAST_CANONICAL_IDS_KEY, JsonValue.wrapOpt(canonicalIds).toString());

        return true;
    }
/**
     * Check to see if we've seen this ID before. If we have,
     * return false. If not, add the ID to our history and return true.
     *
     * @param canonicalId The canonical push ID for an incoming notification.
     * @return <code>false</code> if the ID exists in the history, otherwise <code>true</code>.
     */
Check to see if we've seen this ID before. If we have,
return false. If not, add the ID to our history and return true.

@param canonicalId The canonical push ID for an incoming notification.
@return false if the ID exists in the history, otherwise true.
Check to see if we ' ve seen this ID before . If we have return false . If not add the ID to our history and return true . @param canonicalId The canonical push ID for an incoming notification . @return false if the ID exists in the history otherwise true .
boolean isUniqueCanonicalId(@Nullable String canonicalId) {
        if (UAStringUtil.isEmpty(canonicalId)) {
            return true;
        }
        JsonList jsonList = null;
        try {
            jsonList = JsonValue.parseString(preferenceDataStore.getString(LAST_CANONICAL_IDS_KEY, null)).getList();
        } catch (JsonException e) {
            Logger.debug("PushJobHandler - Unable to parse canonical Ids.", e);
        }
        List<JsonValue> canonicalIds = jsonList == null ? new ArrayList<JsonValue>() : jsonList.getList();
        JsonValue id = JsonValue.wrap(canonicalId);
        if (canonicalIds.contains(id)) {
            return false;
        }
        canonicalIds.add(id);
        if (canonicalIds.size() > MAX_CANONICAL_IDS) {
            canonicalIds = canonicalIds.subList(canonicalIds.size() - MAX_CANONICAL_IDS, canonicalIds.size());
        }
        preferenceDataStore.put(LAST_CANONICAL_IDS_KEY, JsonValue.wrapOpt(canonicalIds).toString());
        return true;
    }
boolean isUniqueCanonicalId ( @ Nullable String canonicalId ) { if ( UAStringUtil . isEmpty ( canonicalId ) ) { return true ; } JsonList jsonList = null ; try { jsonList = JsonValue . parseString ( preferenceDataStore . getString ( LAST_CANONICAL_IDS_KEY , null ) ) . getList ( ) ; } catch ( JsonException e ) { Logger . debug ( "PushJobHandler - Unable to parse canonical Ids." , e ) ; } List < JsonValue > canonicalIds = jsonList == null ? new ArrayList < JsonValue > ( ) : jsonList . getList ( ) ; JsonValue id = JsonValue . wrap ( canonicalId ) ; if ( canonicalIds . contains ( id ) ) { return false ; } canonicalIds . add ( id ) ; if ( canonicalIds . size ( ) > MAX_CANONICAL_IDS ) { canonicalIds = canonicalIds . subList ( canonicalIds . size ( ) - MAX_CANONICAL_IDS , canonicalIds . size ( ) ) ; } preferenceDataStore . put ( LAST_CANONICAL_IDS_KEY , JsonValue . wrapOpt ( canonicalIds ) . toString ( ) ) ; return true ; }
Check to see if we've seen this ID before.
Check to see if we ' ve seen this ID before .
// Wrap the canonicalId // Check if the list contains the canonicalId // Add it // Store the new list