Skip to content

Commit

Permalink
spixi-0.9.4
Browse files Browse the repository at this point in the history
- updated to latest IXI Core
- improved notifications
  • Loading branch information
IxiAngel committed Jan 30, 2025
1 parent f069514 commit 887021b
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 16 deletions.
7 changes: 7 additions & 0 deletions Spixi/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ protected override Window CreateWindow(IActivationState activationState)
{
Shutdown();
};

window.Resumed += (s, e) =>
{
if (Config.enablePushNotifications)
OfflinePushMessages.fetchPushMessages(true);
};

appWindow = window;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Spixi/Data/OfflinePushMessages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static bool sendPushMessage(StreamMessage msg, bool push)
return false;
}

public static bool fetchPushMessages(bool force = false)
public static bool fetchPushMessages(bool force = false, bool fireLocalNotification = false)
{
if(force == false && lastUpdate + cooldownPeriod > Clock.getTimestamp())
{
Expand Down Expand Up @@ -128,7 +128,7 @@ public static bool fetchPushMessages(bool force = false)
f.setPublicKey(pk);
}
}
StreamProcessor.receiveData(data, null);
StreamProcessor.receiveData(data, null, fireLocalNotification);
}
}
catch (Exception e)
Expand Down
2 changes: 1 addition & 1 deletion Spixi/Meta/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class Config
public static readonly int packetDataSize = 102400; // 100 Kb per packet for file transfers
public static readonly long packetRequestTimeout = 60; // Time in seconds to re-request packets

public static readonly string version = "spixi-0.9.3"; // Spixi version
public static readonly string version = "spixi-0.9.4"; // Spixi version

public static readonly string checkVersionUrl = "https://www.ixian.io/spixi-update.txt";
public static readonly int checkVersionSeconds = 1 * 60 * 60; // 1 hour
Expand Down
2 changes: 1 addition & 1 deletion Spixi/Meta/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ public override Block getBlockHeader(ulong blockNum)
return BlockHeaderStorage.getBlockHeader(blockNum);
}

public override IxiNumber getMinSignerPowDifficulty(ulong blockNum, long curBlockTimestamp)
public override IxiNumber getMinSignerPowDifficulty(ulong blockNum, int curBlockVersion, long curBlockTimestamp)
{
// TODO TODO implement this properly
return ConsensusConfig.minBlockSignerPowDifficulty;
Expand Down
4 changes: 2 additions & 2 deletions Spixi/Network/StreamProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public static void handleMsgRead(Address sender, int channel, byte[] msg_id)
}*/

// Called when receiving S2 data from clients
public static void receiveData(byte[] bytes, RemoteEndpoint endpoint)
public static void receiveData(byte[] bytes, RemoteEndpoint endpoint, bool fireLocalNotification = true)
{
if(running == false)
{
Expand Down Expand Up @@ -528,7 +528,7 @@ public static void receiveData(byte[] bytes, RemoteEndpoint endpoint)
else
{*/
// Add the message to the friend list
FriendMessage fm = FriendList.addMessage(message.id, sender_address, spixi_message.channel, Encoding.UTF8.GetString(spixi_message.data), real_sender_address, message.timestamp);
FriendMessage fm = FriendList.addMessage(message.id, sender_address, spixi_message.channel, Encoding.UTF8.GetString(spixi_message.data), real_sender_address, message.timestamp, fireLocalNotification);
//}
}
break;
Expand Down
8 changes: 3 additions & 5 deletions Spixi/Platforms/Android/SPushService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,12 @@ static void handleNotificationReceived(object sender, OneSignalSDK.DotNet.Core.N
{
e.PreventDefault();

if (App.isInForeground)
return;

if (OfflinePushMessages.fetchPushMessages(true))
if (OfflinePushMessages.fetchPushMessages(true, true))
{
//OneSignal.Current.ClearAndroidOneSignalNotifications();
//return;
return;
}

e.Notification.display();
}

Expand Down
2 changes: 1 addition & 1 deletion Spixi/Platforms/Windows/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">

<Identity Name="com.ixilabs.spixi" Publisher="CN=ixiandev" Version="0.9.3.0" />
<Identity Name="com.ixilabs.spixi" Publisher="CN=ixiandev" Version="0.9.4.0" />

<Properties>
<DisplayName>Spixi</DisplayName>
Expand Down
4 changes: 2 additions & 2 deletions Spixi/Platforms/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
<key>NSFaceIDUsageDescription</key>
<string>Biometric authentication for unlocking the app</string>
<key>CFBundleVersion</key>
<string>0.9.3</string>
<string>0.9.4</string>
<key>CFBundleShortVersionString</key>
<string>0.9.3</string>
<string>0.9.4</string>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
Expand Down
4 changes: 2 additions & 2 deletions Spixi/Spixi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<ApplicationId>com.ixilabs.spixi</ApplicationId>

<!-- Versions -->
<ApplicationDisplayVersion>0.9.3</ApplicationDisplayVersion>
<ApplicationVersion>160000930</ApplicationVersion>
<ApplicationDisplayVersion>0.9.4</ApplicationDisplayVersion>
<ApplicationVersion>160000940</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
Expand Down

0 comments on commit 887021b

Please sign in to comment.