/* * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ using System; using System.Net; using UnityEngine; using Amazon.MobileAnalytics; using Amazon.Util.Storage.Internal; namespace Amazon.MobileAnalytics.MobileAnalyticsManager.Internal { public partial class ConnectivityPolicy:IDeliveryPolicy { /// /// Determines whether this instance has network connectivity. /// /// true if this instance has network connectivity; otherwise, false. private bool HasNetworkConnectivity () { NetworkReachability networkReachability = NetworkInfo.Reachability; bool networkFlag = false; switch (networkReachability) { case NetworkReachability.NotReachable: networkFlag = false; break; case NetworkReachability.ReachableViaLocalAreaNetwork: networkFlag = true; break; case NetworkReachability.ReachableViaCarrierDataNetwork: networkFlag = IsDataAllowed; break; } return networkFlag; } /// /// Call back to policy once the delivery has been completed /// On Successful delivery the timestamp is recorded on the local storage /// /// If set to true successful. public void HandleDeliveryAttempt(bool isSuccessful) { } } }